Results 1 to 6 of 6

Thread: asp:net stop rendering html

  1. #1
    Join Date
    Jun 2005
    Location
    Tunbridge Wells, Kent
    Posts
    206
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default asp:net stop rendering html

    with an asp : panel it automatically renders an html div box or table.

    is there a way to stop the panel rendering any html?

  2. #2
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Run the contents through HttpUtility.HtmlEncode should stop that.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  3. #3
    Join Date
    Feb 2004
    Posts
    4,903
    Thanks
    2
    Thanked 134 Times in 113 Posts

    Default

    Quote Originally Posted by Warren Ashcroft View Post
    Run the contents through HttpUtility.HtmlEncode should stop that.
    Oh nevermind, misunderstood the question.
    Warren Ashcroft
    Red Fox UK Limited - Pioneers in Internet Technology
    http://www.redfoxuk.com
    w.ashcroft [at] redfoxuk.com

    NOTE: Forum Private Messaging should not be used to contact staff with support queries.

  4. #4
    Join Date
    Oct 2005
    Location
    Scotland
    Posts
    229
    Thanks
    7
    Thanked 12 Times in 8 Posts

    Default

    Use a contentplaceholder instead of a panel as it doesn't render in a div.

  5. #5
    Join Date
    Oct 2006
    Posts
    38
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    have you had a look at the new CSS friendly control adapters?

    http://www.asp.net/cssadapters/

    Josh

  6. #6
    Join Date
    Jun 2005
    Posts
    1,081
    Thanks
    4
    Thanked 15 Times in 15 Posts

    Default

    You could also create your own Control that inherits from the base control. This could then override the Render method.

    A nice side effect of this ssee if the Panel has contents, and if so you render the panel as a DIV or TABLE (ie. base.Render). However, if the Panel doesn't have any contents then it could render nothing leaving the output Html / XHtml much cleaner.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Localization in asp.net 2.0
    By psykik in forum ASP.NET
    Replies: 4
    Last Post: 25th April 2006, 08:05 AM
  2. ASP.NET book
    By creativeworks in forum ASP.NET
    Replies: 4
    Last Post: 7th February 2006, 02:28 PM
  3. ASP.net 2.0
    By JohnnyW in forum Sales and Service Feature Enquiries
    Replies: 17
    Last Post: 8th November 2005, 01:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •