Results 1 to 3 of 3

Thread: [RESOLVED] Problem displaying comments in inner HTML

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [RESOLVED] Problem displaying comments in inner HTML

    I have to display some HTML from our system and do by using
    DivOutline.InnerHtml = outlinetext;
    where outlinetext is a string of HTML

    However the string contains code as below
    "<!--[if !supportLists]-->"

    which for some reason also gets displayed.

    I think it could be because the actual string is

    ("&lt;!--[

    but even when I try
    outlinetext.Replace("&lt;", "<");

    the text does not seem to get replaced

    Can anyone tell my either how to make the comments not display or why the string.replace function cannot pict out "&lt" when I can see it is definately in the string?

  2. #2

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: Problem displaying comments in inner HTML

    Resolved
    Code:
       outlinetext =  outlinetext.Replace("<!--", "<!-- ");
                               outlinetext = outlinetext.Replace("&lt;", "<");
                              //  outlinetext.Replace("<!--[if !supportLists]-->", "");
                               outlinetext = outlinetext.Replace("&gt;", ">");
                               outlinetext = outlinetext.Replace("-->", " -->");                        
                            //  outlinetext.Replace("&lt;!--[endif]--&gt;", "");

  3. #3
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: [RESOLVED] Problem displaying comments in inner HTML

    Hello,

    Out of interest, what type of control is DivOutline?

    I have found that writing HTML into a Literal control provides better success than most of the others.

    Gary

Posting Permissions

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



Click Here to Expand Forum to Full Width