Show HTML String

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Just D.

    Show HTML String

    All,

    What's the simplest way to show my own HTML string on the ASPX page assuming
    that this page is just created using the wizard and it has nothing on it?
    We're free to use any control adding it to this page just to show this HTML
    string. I know that in some cases we can use .InnerHtml property of some
    controls to inject the HTML string created in C# code, but it didn't work in
    my case. I tried to use TEXTAREA1.Inner Html and it shows me the HTML string
    instead of formatted string. What's wrong?

    Just D.


  • Sean

    #2
    RE: Show HTML String

    are you trying to display html tags as string literals which are created from
    the server side? or are you trying to render html tags generated from the
    server?

    ie. do you want "<table><tr>... " shown up to the user or do you want an
    actual table?

    for an actual table which gets created from server side code you can use
    literalcontrol class (i think that is right anyway).

    if you want string literal of html tags I think you have to look up escape
    ascii codes for that ( i think). i also think some controls have an option to
    not render as HTML.

    If by chance what you are wanting is more basic say have HTML tags inside a
    aspx page all you need to do is make sure <html<bodyetc are not in the
    HTML you are intrested in displaying.

    So for example if you have a HTML page already just copy everything past
    <bodyor <formbasicall y all ASPX content is rendered inside a form tag so
    no form inside a form if that makes sense.

    "Just D." wrote:
    All,
    >
    What's the simplest way to show my own HTML string on the ASPX page assuming
    that this page is just created using the wizard and it has nothing on it?
    We're free to use any control adding it to this page just to show this HTML
    string. I know that in some cases we can use .InnerHtml property of some
    controls to inject the HTML string created in C# code, but it didn't work in
    my case. I tried to use TEXTAREA1.Inner Html and it shows me the HTML string
    instead of formatted string. What's wrong?
    >
    Just D.
    >
    >
    >

    Comment

    • PeterKellner

      #3
      Re: Show HTML String

      On Fri, 28 Jul 2006 20:54:56 -0700, "Just D." <no@spam.please wrote:
      >All,
      >
      >What's the simplest way to show my own HTML string on the ASPX page assuming
      >that this page is just created using the wizard and it has nothing on it?
      >We're free to use any control adding it to this page just to show this HTML
      >string. I know that in some cases we can use .InnerHtml property of some
      >controls to inject the HTML string created in C# code, but it didn't work in
      >my case. I tried to use TEXTAREA1.Inner Html and it shows me the HTML string
      >instead of formatted string. What's wrong?
      >
      >Just D.
      >
      I'd suggest using the text property of the Label control
      Peter Kellner

      Comment

      • Sean

        #4
        Re: Show HTML String

        if you do <br/on the .text value of a textbox control it does not render
        display as <br/but rather gives a new line.

        So it does depend on what he means when he says html if you follow what I am
        saying.

        "PeterKelln er" wrote:
        On Fri, 28 Jul 2006 20:54:56 -0700, "Just D." <no@spam.please wrote:
        >
        All,

        What's the simplest way to show my own HTML string on the ASPX page assuming
        that this page is just created using the wizard and it has nothing on it?
        We're free to use any control adding it to this page just to show this HTML
        string. I know that in some cases we can use .InnerHtml property of some
        controls to inject the HTML string created in C# code, but it didn't work in
        my case. I tried to use TEXTAREA1.Inner Html and it shows me the HTML string
        instead of formatted string. What's wrong?

        Just D.
        >
        I'd suggest using the text property of the Label control
        Peter Kellner

        >

        Comment

        Working...