question

  • Thread starter Thread starter abcd
  • Start date Start date
A

abcd

Can you access the HTML server controls from the Web Server control's event
handler?

I have declared HTML server control (Table control) and I want to access
that from the DropDownlist Web server control's SelectedIndexChanged event
handler...

How can I do this..whats the syntax....

thanks
 
As long as you have:
runat="server"
on a tag, and you assign its "id" property, you can access it from any code
that is a method belonging to the form class. How you do that depends on
the language, and how you put the tag (or control) on the form.

In the C# development environment, if you modify the page in HTML view then
go back to design view, it will automatically generate member variables for
the element that you've added to the page. If you drop a control on the
form (assuming its a server-side control with runat="server") it will do
likewise.
 
Wonderful !! this is valuable...

You know what I just modified HTML tags to Runat=server and was expecting to
show those controls for me in the server code but the trick is to click
Design view to generate those control variables first on the form page
class...

great

thanks
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top