.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Why we use runat="server"

Posted By: Aamrapali Tamgadge     Posted Date: November 03, 2011    Points:5   Category :ASP.Net
Hi Friends My Question is that why we use runat="server" in asp.net what is the role of it.

Responses
Author: Cheta             
Posted Date: November 03, 2011     Points: 20   

Hi,

I understand your point, but the importance of [runat="server"] is more for consistancy and extensibility. If the developer has to mark some tags some ways (ie an "asp:" prefix) and in other cases using runat, then it creates more confusion. Also, this simplifies what is sent directly to the user agent as a Response.Write and what needs to be parsed by the ASP.NET engine. What if some user agent of the future has a name collision with one of the ASP.NET tags, it would be difficult otherwise to tell ASP.NET to ignore a tag.


Author: Akhil Raj       [Moderator]      
Posted Date: November 04, 2011     Points: 20   

Please read the following forums

http://stackoverflow.com/questions/304290/asp-net-why-runat-server
http://mikeschinkel.com/blog/whyrunatserverforaspnetpart2/
http://www.velocityreviews.com/forums/t73229-runat-server.html

Author: Maverick             
Posted Date: November 18, 2011     Points: 20   

Hello,

You cannot access your control on server side until runat = server is not specified

Thanks,
Maverick


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend