Access HtmlControls in code-behind

Discussion in 'ASP .Net' started by Greg Linwood, Dec 2, 2003.

  1. Greg Linwood

    Greg Linwood Guest

    How does one access HTML elements from code-behind?

    I've got a mix of asp:Labels & <font> elements - I'd like to continue using
    <font> elements, but be able to access them from code-behind to set
    properties such as InnerHTML, InnerText etc..

    Is this possible?

    Regards,
    Greg Linwood
    SQL Server MVP
     
    Greg Linwood, Dec 2, 2003
    #1
    1. Advertising

  2. Greg Linwood

    Greg Linwood Guest

    OK - thanks - I managed to find that eventually..

    Me.[control name].InnerHTML... so easy!

    Regards,
    Greg Linwood
    SQL Server MVP

    "Greg Linwood" <> wrote in
    message news:...
    > How does one access HTML elements from code-behind?
    >
    > I've got a mix of asp:Labels & <font> elements - I'd like to continue

    using
    > <font> elements, but be able to access them from code-behind to set
    > properties such as InnerHTML, InnerText etc..
    >
    > Is this possible?
    >
    > Regards,
    > Greg Linwood
    > SQL Server MVP
    >
    >
     
    Greg Linwood, Dec 2, 2003
    #2
    1. Advertising

  3. Greg Linwood

    Bharat Guest

    Hi,

    If you say run at server in the HTML tag you can access
    that control in your code-behind file. But not all the
    HTML tag can be accessed for the list of supported HTML
    control you can class in the System.Web.UI.HtmlControls
    namespace.

    HTH,
    Thanks
    Bharat Kumar Agrawal
    >-----Original Message-----
    >How does one access HTML elements from code-behind?
    >
    >I've got a mix of asp:Labels & <font> elements - I'd

    like to continue using
    ><font> elements, but be able to access them from code-

    behind to set
    >properties such as InnerHTML, InnerText etc..
    >
    >Is this possible?
    >
    >Regards,
    >Greg Linwood
    >SQL Server MVP
    >
    >
    >.
    >
     
    Bharat, Dec 2, 2003
    #3
    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. Gopal Prabhakaran

    Difference between HtmlControls and server controls

    Gopal Prabhakaran, Jan 26, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,448
    Rainer Maurer [MS]
    Jan 26, 2004
  2. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    655
    Alphonse Giambrone
    Jun 28, 2003
  3. szabelin
    Replies:
    0
    Views:
    483
    szabelin
    Aug 4, 2003
  4. Daniel Manes

    Code-Behind Pain in the Behind!

    Daniel Manes, Jun 10, 2005, in forum: ASP .Net
    Replies:
    11
    Views:
    715
  5. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    540
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
Loading...

Share This Page