Understanding Code Behind in .Net Framework

Understanding Code Behind in .Net Framework

The ASP.NET Code Behind feature in .Net Framework allows developers to separate the server-side code from the presentation layer. This concept makes the server-side code to store in one file and the presentation code, that is, HTML code in another file. When you compile the ASP.NET page both these files get compiled as a single entity. In the traditional ASP model, this could not be achieved which often leads to intermingling of the code and the design.

The biggest advantage, in ASP.NET, is that the presentation code will be in .aspx file and the server-side code will be in any .Net compatible language such as Visual Basic.Net, C#, or J#. You can also do away with the presentation layer because you can give this role to the web designers. This saves time and you can concentrate only on the coding part of the application. In addition, you can create a class for your code and inherit this class from the ASP.NET Page object. By this way the class can access the page intrinsics and also interact with the postback architecture. After this you can create the ASP.NET page and apply a page directive to inherit from this new class.

But before you create an ASP.NET Code Behind class, you have to reference it to a namespace. The namespace could be System.Web.UI or` System.Web.UI.WebControls. Next you have to inherit the class from the Page object. You must declare some public instances of server controls using the name for the variables that are similar to the web controls. This procedure will create a link between the ASP.NET Code Behind class and the server controls.

You can use the ASP.NET Code Behind feature in various web applications development tools such as Visual Studio.Net and ASP.NET Web Matrix. They provide very easy ways to use the ASP.NET Code Behind. After dragging and dropping the server control from the Toolbox to the web page you can just right click on it to view the ASP.NET Code Behind page.

To access online version of the above article, go to http://www.dotnet-guide.com/codebehind.html

About the Author

Visit http://www.dotnet-guide.com for a complete introduction to .NET framework. Learn about ASP.NET, VB.NET, C# and other related technologies.

More Computers and The Internet and other resouces to help you locate great articles just like Understanding Code Behind in .Net Framework :

Here are other categories to find more must know information on anything and everything.
Auto and Trucks
Business and Finance
Computers and Internet
Education
Environment
Family
Food and Drink
Gadgets and Gizmos
Gardening
Government
Health
Hobbies
Home Improvement
Kids and Teens
Legal Matters
Marketing
Music and Entertainment
Online Business
Parenting
Pets and Animals
Recreation and Sports
Self Improvemen
Site Promotion
Travel and Leisure
Web Development
Women
Writing
Here are more Computers and The Internet articles to give you more must know information just like in Understanding Code Behind in .Net Framework article.

LiveCamNetwork.com Announces Its Fall Line-Up
(Toronto) September 7, 2004 -- Studio manager at LiveCamNetwork.com, Office Gnome has settled on her chat hostesses for the coming pre-glacial months of early winter.

While Office Gnome has been hard at work dealing with schedules, interviews and ...
Read more


Oracle Development: JDeveloper 10G – Java, J2EE, EJB, MVC, XML - overview for programmer
In 2004 Oracle, Inc. made its new step toward J2EE application development simplification, releasing new RAD Oracle JDeveloper 10G. First of all JDeveloper 10G is targeted to rapid web application bu...
Read more


Great Plains Dynamics/eEnterprise Upgrade – things to consider and FAQ
If you have Great Plains Dynamics/eEnterprise (version 6.0 or earlier) and support it for your company then you need to know some technical details about Great Plains version upgrade and what is goin...
Read more


Further Down Along The Information Highway
You should only continue reading this article if you have discovered the profit potential in two things... ...Information and eBay. Without having a clear belief in your ability to create money from...
Read more


The Life, Music, and Spirituality of George Harrison
Propelled into fame as one of the Beatles, along with Paul McCartney, John Lennon, and Ringo Starr, George Harrison was known as the "quiet one" of the group, and also as the "spiritual one." He was the lead guitarist.

He happened to meet Ravi ...
Read more


 

Thank you very much for viewing this must know article: Understanding Code Behind in .Net Framework . Hopefully you have found all the information you were looking for in " Understanding Code Behind in .Net Framework ". If you feel like you need more information feel free to check out Info Pom HOMEPAGE to look for more articles in our humangous database

Site Partners:
Background Check