locked
Login Control Adapter Rendering Question RRS feed

  • Question

  • User1726318880 posted

    All I'm looking to do is remove the outer most <table> from a templated Login control and use what I've put inside the <LayoutTemplate></LayoutTemplate> to render the exact HTML I'm looking for. No extra <div> or <span> tags are needed or wanted.

    What is the easiest method to do this using a ControlAdapter?

    Jeff Lynch
    MVP Windows Server System - Commerce Server
    http://codebetter.com/blogs.jeff.lynch


     

    Tuesday, February 26, 2008 5:45 PM

Answers

  • User-1385398420 posted

    Jeff -- when you use your own layout template instead of using what the adapter gives you, it should only give you the outer div. At least, I think the recent CodePlex versions of the adapter do. (I know early versions, especially the betas, had issues with this.) I always use my own template, and I don't use tables for layouts, which was why rolling my own class that stripped table tags worked well for me.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 27, 2008 2:10 PM

All replies

  • User-1385398420 posted

    You can try the CSS adapters, but if they don't do the trick, you can use a hack I wrote about some two years ago.

    http://www.sidesofmarch.com/index.php/archive/2006/05/05/removing-the-table-from-aspnet-controls-a-fully-working-version/

     

    Tuesday, February 26, 2008 10:42 PM
  • User1726318880 posted

     Brian,

    My problem with the Login CSS Control Adapter is the number of extra divs and spans created as well as the hard-coded CSS class names used. I'd like an approach more like the new .NET 3.5 ListView control, where the developer is responsible for creating the layout template code including the "required" controls.

    I've read your post (and almost all of your blog!) about this but I'd like to do this in a Control Adapter rather than overriding the Login class itself. I can't seem to find where the outer most table (with a single row and cell) is created in the Login class using Reflector. Since you and  Russ are the most familiar with the CSS Control Adapters, I was hoping that you could point me in the right direction.

    I want the control adapter to create a simple <div id="something"></div> around whatever is found in the <LayoutTemplate></LayoutTemplate> element of the Login control, rather than creating the outer most table (with a single row and cell). 

    Any help is greatly appreciated and I'm not above bribery with some MSFT swag [;)]

    Jeff Lynch
    MVP Windows Server System - Commerce Server
    http://codebetter.com/blogs/jeff.lynch


     

    Wednesday, February 27, 2008 10:20 AM
  • User-1385398420 posted

    Jeff -- when you use your own layout template instead of using what the adapter gives you, it should only give you the outer div. At least, I think the recent CodePlex versions of the adapter do. (I know early versions, especially the betas, had issues with this.) I always use my own template, and I don't use tables for layouts, which was why rolling my own class that stripped table tags worked well for me.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, February 27, 2008 2:10 PM