No need to type runat=”server” now

Virendradugar
Posted by in ASP.NET category on for Beginner level | Views : 4813 red flag
Rating: 4 out of 5  
 1 vote(s)

This is related to ASP.NET 4.0, where now there is no need to type runat attribute.

Introduction

If you are using Visual Studio 2005 or 2008, for every asp.net or Html control, you need to explicity write runat=”server” attribute. Sometimes I really wonder, why I have to write this attribute for every control as most of time I want to access controls on server side. Is n’t is tedious task? It should be added automatically. But it’s not possible with Visual Studio 2005 or 2008.

Well, we have a good news now. Now there is no need to type runat=”server“. It does not mean that It has been removed. Nope.. it’s get added automatically in VS 2010. Wow.. amazing..

In VS 2010, Microsoft has added hundereds of new code snippest for HTML, JavaScript and for ASPX.  If you want to place a textbox on the page, type tb and press Tab. Wow… You will see something like this..

<asp:TextBox ID="TextBox1" runat="server"/>

Type req and press Tab. Boom…

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1" ErrorMessage="errormessage"></asp:RequiredFieldValidator>

There are lots of other code snippest almost for every control. Even for HTML tag also like table. Is n’t is cool?

Check out this video by Jeff king on new web development features of VS 2010.

Enjoy…


Page copy protected against web site content infringement by Copyscape

About the Author

Virendradugar
Full Name: Virendra Dugar
Member Level: Silver
Member Status: Member,MVP
Member Since: 8/11/2009 4:14:05 AM
Country: India

http://jquerybyexample.blogspot.com
Virendra Dugar is experienced Senior Software Developer with over 5 years of hands-on experience working with Microsoft .NET technology (ASP.NET, C#, VB.NET,SQL Server). He is always keen to learn new technology. He holds a Master's Degree in Computer Application & Information technology from Gujarat University in india.In free time, he loves to listen music, read books, play games and do blogging etc. Visit his blogs : http://jquerybyexample.blogspot.com

Login to vote for this post.

Comments or Responses

Posted by: Vuyiswamb on: 4/4/2011 | Points: 25
Nice info , thanks for sharing
Posted by: Virendradugar on: 4/4/2011 | Points: 25
:)

Thanks,
Virendra Dugar

Login to post response

Comment using Facebook(Author doesn't get notification)