Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why do I have to specify runat="server" on all my ASP.NET controls ...Please tell me what is the reason...give me explanations for it
Posted

By settting runat="server" this property to controls that control is available to you on code behind.
This is the property which makes difference between HTML control and ASP controls.

hope this helps you.
 
Share this answer
 
Comments
Member 8405530 3-May-12 3:53am    
thank u
runat="server" Because it's server side controls too simple
 
Share this answer
 
v2
Comments
Member 8405530 3-May-12 3:53am    
thank u
You can get detailed answer on following thread:
Why does ASP.NET webforms need the Runat=“Server” attribute[^]

Any element marked with runat="server" lets the framework know that this will be a control on the server side. This article has more details:
Exploring the Runat Attribute[^]

[EDIT]
Here's another good article i have found, you'll surely get some more needful from it:
Why does ASP.NET Webforms use the “Runat=Server” attribute[^]
 
Share this answer
 
v2
Comments
Member 8405530 3-May-12 3:53am    
thank u
Prasad_Kulkarni 3-May-12 5:12am    
If its really helpful for you then formally 'Accept Solution'.
sangel1989 9-May-12 7:43am    
Nice links.
Prasad_Kulkarni 22-May-12 6:38am    
Thank you sangel

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900