I will be blogging on ASP.NET and publishing on the following topics of ASP.NET 4.0
Introduction to ASP.NET
- Agenda :
<b color=blue> this</b> this
||ASP.NET MVC is also based on ASP.NET and it is low level programming technology.|
||ASP.NET MVC uses HTML controls and requires knowledge of JS plugins.|
||ASP.NET MVC directly use HTML controls hence require deep knowledge of HTML and HTTP. They have total control of HTML markup.|
||ASP.NET MVC supports unit testing, TDD and Agile.|
||Browser differences and OS compatibility needs to be care by the developer.|
What is ASP.NET
ASP.NET is free framework using C# and VB. Visual studio provides Visual Web Developer for free to develop standalone website. The Intellisense of Visual Studio helps to understand the libraries used for developing website. Visual Studio has powerful debugging tool. ASP.NET is part of .NET, Website Spark is a development program to develop website and it is free software.
|How text is displayed||Provides information about the text|
|HTML is parsed and interpreted by browser and then displayed.||Using XML to provide a data for information requested and provides the data as response in XML.|
|Static Web Pages||Dynamic Web Pages|
|A plain HTML page which doesn’t change during interaction with the user is Static Web Page.||An .aspx page is analyzed and CLR executes code in it by server to generate dynamic page. Finally the response data is converted to HTML page for each request.|
Working with the Server
- Server does everything for every user request.
- Dynamic Page forces Server to do everything lead to poor performance.
- Server manages the HTTP state session.
The .aspx page is a dynamic page follows the request and response model. And it has unique session for each request.
Client information and session information to recognize the request originate information for the server.
When 1st request is sent, server creates session and is managed by server. Session management require server resources. Time out limit is set by the web application, after limit the session expires. So before the session expires an interaction between the client and server should be made.
1st request à Parser à compile à IL code in Assembly Cache à Memory Execute http runtime.
2nd request ——————————————————————àMemory Execute http runtime.
Server Control : Server control is configured before hand during design time. The request for the web page makes the dynamic page to execute the program logic at the server and deliver it as HTML control to client. E.g. gridView control, calendar control.
Code Behind: VB/C# code in another page with extension .cs is code behind of web page.
ASP.NET Framework which is composed of WebMatrix, WebForms, ASP.NET MVC is required to build websites, web application.
State Management and AutoPostback
Web pages are HTTP based and are stateless, the stateless nature is a problem.
ASP.NET maintains the HTTP state automatically. set EnableViewState to true in properties window to enable Postback.
What is ViewState ? ViewState is a hidden value containing state information.
Autopostback – When a whole page is sent back to server with new option selected is a AutopostBack property.
ASP.NET supports client side scripting.
Validation controls: A special control under validation section in toolbox; Select required control in it and drop them on the web design. Select the control to validate. Only works with Server controls. So Validation controls to works with HTML convert html control to Server control.