possible to manipulate pure HTML controls from code-behind?

Discussion in 'ASP .Net' started by Jeff, Nov 2, 2003.

  1. Jeff

    Jeff Guest

    Can I manipulate the properties of pure HTML controls (i.e. not server side
    controls) from my aspx.cs Page_Load event? If so, I don't see the control
    listed by intellisense. I gave the control a unique ID to boot. Is what
    I'm trying impossible unless you are using a server side control?

    Thanks
    Jeff, Nov 2, 2003
    #1
    1. Advertising

  2. Re : possible to manipulate pure HTML controls from code-behind?

    Hi

    You have to use the RUNAT = "SERVER" attribute for the
    controls to be accessed from Server side.

    The following link will be helpful to you in understandin
    g the difference between HTML Controls and Server Con
    trols. Note that both these controls require RUNAT
    = "SERVER" for accessing them from Server side

    -Gopi

    >-----Original Message-----
    >Can I manipulate the properties of pure HTML controls

    (i.e. not server side
    >controls) from my aspx.cs Page_Load event? If so, I

    don't see the control
    >listed by intellisense. I gave the control a unique ID

    to boot. Is what
    >I'm trying impossible unless you are using a server side

    control?
    >
    >Thanks
    >
    >
    >.
    >
    S Gopikrishna, Nov 2, 2003
    #2
    1. Advertising

  3. Hi

    I think you can't manipulate HTML control unless are server-side control
    (runat = server)

    If your HTM pure controls contain the runat=server attribute you can find
    the control in the "System.Web.UI.HtmlControls" namespace therefore in the
    Page_Load event:

    protected System.Web.UI.HtmlControls.HtmlInputButton button2;

    private void Page_Load(object sender, System.EventArgs e)
    {
    button2.Value = "Go";
    }

    Ciao
    Giorgio

    "Jeff" <> ha scritto nel messaggio
    news:3fa55519$...
    > Can I manipulate the properties of pure HTML controls (i.e. not server

    side
    > controls) from my aspx.cs Page_Load event? If so, I don't see the control
    > listed by intellisense. I gave the control a unique ID to boot. Is what
    > I'm trying impossible unless you are using a server side control?
    >
    > Thanks
    >
    >
    Giorgio Parmeggiani, Nov 2, 2003
    #3
  4. Jeff

    Bucko Guest

    Keep in mind also you can use the generic html control for things such
    as <body> tags. (if you wanted to programmatically change body tag
    attributes)

    Giorgio Parmeggiani wrote:

    > Hi
    >
    > I think you can't manipulate HTML control unless are server-side control
    > (runat = server)
    >
    > If your HTM pure controls contain the runat=server attribute you can find
    > the control in the "System.Web.UI.HtmlControls" namespace therefore in the
    > Page_Load event:
    >
    > protected System.Web.UI.HtmlControls.HtmlInputButton button2;
    >
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > button2.Value = "Go";
    > }
    >
    > Ciao
    > Giorgio
    >
    > "Jeff" <> ha scritto nel messaggio
    > news:3fa55519$...
    >
    >>Can I manipulate the properties of pure HTML controls (i.e. not server
    >>

    > side
    >
    >>controls) from my aspx.cs Page_Load event? If so, I don't see the control
    >>listed by intellisense. I gave the control a unique ID to boot. Is what
    >>I'm trying impossible unless you are using a server side control?
    >>
    >>Thanks
    >>
    >>
    >>

    >
    >
    Bucko, Nov 2, 2003
    #4
    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. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    569
    Alphonse Giambrone
    Jun 28, 2003
  2. Norm  via DotNetMonster.com

    mixing HTML controls with code behind controls

    Norm via DotNetMonster.com, May 10, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,534
    Norm via DotNetMonster.com
    May 10, 2005
  3. Dave
    Replies:
    1
    Views:
    316
    Mike Wahler
    Jan 22, 2005
  4. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    465
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  5. mike_bluestein@ya_StopSpammingMe_hoo.com

    possible to manipulate pure HTML controls from code-behind?

    mike_bluestein@ya_StopSpammingMe_hoo.com, Nov 3, 2003, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    142
    mike_bluestein@ya_StopSpammingMe_hoo.com
    Nov 3, 2003
Loading...

Share This Page