How to insert HTML strings in ASP.net

Discussion in 'ASP .Net' started by =?Utf-8?B?QW5kcmV3?=, Sep 9, 2005.

  1. Hi, friends,

    In ASP, we use
    obj = CreateObject("com.dll")
    obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
    to get different HTML strings based on input values.

    Then, we insert them into proper location of HTML something like the
    following:
    <table>
    <% = outHTMLTxt1 %>
    </table>

    In ASP.net, how do we do this? I looked into Page_Load() event, and I could
    get different HTML strings, but I did not know how to insert them into proper
    location of HTML.

    Any sample source code or reference papers? Help please.

    Thanks a lot
     
    =?Utf-8?B?QW5kcmV3?=, Sep 9, 2005
    #1
    1. Advertising

  2. you can either use a control, which is what I recommend, or you can still do
    inline coding with asp.net.. the <% %> is still usable.

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com



    "Andrew" wrote:

    > Hi, friends,
    >
    > In ASP, we use
    > obj = CreateObject("com.dll")
    > obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
    > to get different HTML strings based on input values.
    >
    > Then, we insert them into proper location of HTML something like the
    > following:
    > <table>
    > <% = outHTMLTxt1 %>
    > </table>
    >
    > In ASP.net, how do we do this? I looked into Page_Load() event, and I could
    > get different HTML strings, but I did not know how to insert them into proper
    > location of HTML.
    >
    > Any sample source code or reference papers? Help please.
    >
    > Thanks a lot
     
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Sep 9, 2005
    #2
    1. Advertising

  3. But, I do not have object, such as com.dll, any more. I created different
    HTML strings in Page_load(). How can I instert it in HTML? Any sample code?

    "Curt_C [MVP]" wrote:

    > you can either use a control, which is what I recommend, or you can still do
    > inline coding with asp.net.. the <% %> is still usable.
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    >
    >
    >
    > "Andrew" wrote:
    >
    > > Hi, friends,
    > >
    > > In ASP, we use
    > > obj = CreateObject("com.dll")
    > > obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
    > > to get different HTML strings based on input values.
    > >
    > > Then, we insert them into proper location of HTML something like the
    > > following:
    > > <table>
    > > <% = outHTMLTxt1 %>
    > > </table>
    > >
    > > In ASP.net, how do we do this? I looked into Page_Load() event, and I could
    > > get different HTML strings, but I did not know how to insert them into proper
    > > location of HTML.
    > >
    > > Any sample source code or reference papers? Help please.
    > >
    > > Thanks a lot
     
    =?Utf-8?B?QW5kcmV3?=, Sep 9, 2005
    #3
  4. Huh?
    What specifically is your question? Is it how to get a string/text/html from
    code onto the page, or how to get the string/text/html out of a DLL you wrote?

    --
    Curt Christianson
    site: http://www.darkfalz.com
    blog: http://blog.darkfalz.com



    "Andrew" wrote:

    > But, I do not have object, such as com.dll, any more. I created different
    > HTML strings in Page_load(). How can I instert it in HTML? Any sample code?
    >
    > "Curt_C [MVP]" wrote:
    >
    > > you can either use a control, which is what I recommend, or you can still do
    > > inline coding with asp.net.. the <% %> is still usable.
    > >
    > > --
    > > Curt Christianson
    > > site: http://www.darkfalz.com
    > > blog: http://blog.darkfalz.com
    > >
    > >
    > >
    > > "Andrew" wrote:
    > >
    > > > Hi, friends,
    > > >
    > > > In ASP, we use
    > > > obj = CreateObject("com.dll")
    > > > obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
    > > > to get different HTML strings based on input values.
    > > >
    > > > Then, we insert them into proper location of HTML something like the
    > > > following:
    > > > <table>
    > > > <% = outHTMLTxt1 %>
    > > > </table>
    > > >
    > > > In ASP.net, how do we do this? I looked into Page_Load() event, and I could
    > > > get different HTML strings, but I did not know how to insert them into proper
    > > > location of HTML.
    > > >
    > > > Any sample source code or reference papers? Help please.
    > > >
    > > > Thanks a lot
     
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=, Sep 9, 2005
    #4
  5. For exmple, in Page_Load()

    newHTMLStr = "<tr><td>....";

    If I use Reponse.Write(newHTMLStr), all those <tr><td> element will be on
    the top of web page. But, I want to inert those <tr><td> elements into
    <table></table>. This <table></table> element was already created when I
    designed the web page by draging and droping it in a web form.

    My question is: How to insert this new created newHTMLStr into pre-existing
    <table></table> element so that we have cells in the previouly empty
    <table></table> element.


    "Curt_C [MVP]" wrote:

    > Huh?
    > What specifically is your question? Is it how to get a string/text/html from
    > code onto the page, or how to get the string/text/html out of a DLL you wrote?
    >
    > --
    > Curt Christianson
    > site: http://www.darkfalz.com
    > blog: http://blog.darkfalz.com
    >
    >
    >
    > "Andrew" wrote:
    >
    > > But, I do not have object, such as com.dll, any more. I created different
    > > HTML strings in Page_load(). How can I instert it in HTML? Any sample code?
    > >
    > > "Curt_C [MVP]" wrote:
    > >
    > > > you can either use a control, which is what I recommend, or you can still do
    > > > inline coding with asp.net.. the <% %> is still usable.
    > > >
    > > > --
    > > > Curt Christianson
    > > > site: http://www.darkfalz.com
    > > > blog: http://blog.darkfalz.com
    > > >
    > > >
    > > >
    > > > "Andrew" wrote:
    > > >
    > > > > Hi, friends,
    > > > >
    > > > > In ASP, we use
    > > > > obj = CreateObject("com.dll")
    > > > > obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
    > > > > to get different HTML strings based on input values.
    > > > >
    > > > > Then, we insert them into proper location of HTML something like the
    > > > > following:
    > > > > <table>
    > > > > <% = outHTMLTxt1 %>
    > > > > </table>
    > > > >
    > > > > In ASP.net, how do we do this? I looked into Page_Load() event, and I could
    > > > > get different HTML strings, but I did not know how to insert them into proper
    > > > > location of HTML.
    > > > >
    > > > > Any sample source code or reference papers? Help please.
    > > > >
    > > > > Thanks a lot
     
    =?Utf-8?B?QW5kcmV3?=, Sep 9, 2005
    #5
  6. =?Utf-8?B?QW5kcmV3?=

    Jeremy S. Guest

    Check out the Literal control

    Basically you would declare a Literal control in your HTML table - where you
    want the inserted HTML to go. Then, in your code behind, you'd set the .Text
    property of the Literal control to your HTML string. It's that simple.

    If you want your HTML to be styled, then you'd have to use inline CSS or set
    the css class property directly in the HTML string you are inserting.

    http://www.w3schools.com/aspnet/control_literal.asp

    http://msdn.microsoft.com/library/d...rfsystemwebuiwebcontrolsliteralclasstopic.asp


    -HTH


    "Andrew" <> wrote in message
    news:...
    > For exmple, in Page_Load()
    >
    > newHTMLStr = "<tr><td>....";
    >
    > If I use Reponse.Write(newHTMLStr), all those <tr><td> element will be on
    > the top of web page. But, I want to inert those <tr><td> elements into
    > <table></table>. This <table></table> element was already created when I
    > designed the web page by draging and droping it in a web form.
    >
    > My question is: How to insert this new created newHTMLStr into
    > pre-existing
    > <table></table> element so that we have cells in the previouly empty
    > <table></table> element.
    >
    >
    > "Curt_C [MVP]" wrote:
    >
    >> Huh?
    >> What specifically is your question? Is it how to get a string/text/html
    >> from
    >> code onto the page, or how to get the string/text/html out of a DLL you
    >> wrote?
    >>
    >> --
    >> Curt Christianson
    >> site: http://www.darkfalz.com
    >> blog: http://blog.darkfalz.com
    >>
    >>
    >>
    >> "Andrew" wrote:
    >>
    >> > But, I do not have object, such as com.dll, any more. I created
    >> > different
    >> > HTML strings in Page_load(). How can I instert it in HTML? Any sample
    >> > code?
    >> >
    >> > "Curt_C [MVP]" wrote:
    >> >
    >> > > you can either use a control, which is what I recommend, or you can
    >> > > still do
    >> > > inline coding with asp.net.. the <% %> is still usable.
    >> > >
    >> > > --
    >> > > Curt Christianson
    >> > > site: http://www.darkfalz.com
    >> > > blog: http://blog.darkfalz.com
    >> > >
    >> > >
    >> > >
    >> > > "Andrew" wrote:
    >> > >
    >> > > > Hi, friends,
    >> > > >
    >> > > > In ASP, we use
    >> > > > obj = CreateObject("com.dll")
    >> > > > obj.GetHTMLText(inVal, outHTMLTxt1, outHTMLTxt2)
    >> > > > to get different HTML strings based on input values.
    >> > > >
    >> > > > Then, we insert them into proper location of HTML something like
    >> > > > the
    >> > > > following:
    >> > > > <table>
    >> > > > <% = outHTMLTxt1 %>
    >> > > > </table>
    >> > > >
    >> > > > In ASP.net, how do we do this? I looked into Page_Load() event, and
    >> > > > I could
    >> > > > get different HTML strings, but I did not know how to insert them
    >> > > > into proper
    >> > > > location of HTML.
    >> > > >
    >> > > > Any sample source code or reference papers? Help please.
    >> > > >
    >> > > > Thanks a lot
     
    Jeremy S., Sep 9, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rick Spiewak
    Replies:
    5
    Views:
    824
    Lewis Wang [MSFT]
    Aug 1, 2003
  2. Replies:
    3
    Views:
    12,181
    Beauregard T. Shagnasty
    Jan 10, 2006
  3. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    767
    Malcolm
    Jun 24, 2006
  4. mcnewsxp

    insert html into html

    mcnewsxp, Mar 30, 2010, in forum: HTML
    Replies:
    24
    Views:
    4,428
    cipherd
    Jan 7, 2012
  5. Sara T.
    Replies:
    1
    Views:
    187
    JuanDG
    Oct 25, 2004
Loading...

Share This Page