0% found this document useful (0 votes)
54 views11 pages

Arpit Singh Btech IT 090102014

ASP.NET is a framework for building web sites and applications that runs on the server-side. It supports Web Forms, Web Pages, and MVC approaches. ASP.NET code is compiled to run inside IIS and outputs pure HTML to browsers. It features server controls like HTML controls, web controls, and validation controls that add dynamic functionality. ASP.NET is not backward compatible with ASP and was rewritten from scratch as part of the .NET Framework.

Uploaded by

Arpit Singh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views11 pages

Arpit Singh Btech IT 090102014

ASP.NET is a framework for building web sites and applications that runs on the server-side. It supports Web Forms, Web Pages, and MVC approaches. ASP.NET code is compiled to run inside IIS and outputs pure HTML to browsers. It features server controls like HTML controls, web controls, and validation controls that add dynamic functionality. ASP.NET is not backward compatible with ASP and was rewritten from scratch as part of the .NET Framework.

Uploaded by

Arpit Singh
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

SWD with .

NET presentation on

ASP.NET

Arpit Singh Btech IT 090102014

ASP.NET

ASP.NET is a framework for building web sites and web applications. It supports three approaches to build web sites:

Web Pages Web Forms MVC

It is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. ASP.NET is a program that runs inside IIS (Internet Information Services)

How ASP.NET Works

ASP.NET is purely server-side technology. ASP.NET code executes on the server before it is sent to the browser. The code that is sent back to the browser is pure HTML and not ASP.NET code. Like client-side scripting, ASP.NET code is similar in a way that it allows you to write your code alongside HTML. Unlike client-side scripting, ASP.NET code is executed on the server and not in the browser. The script that you write alongside your HTML is not sent back to the browser and that prevents others from stealing the code you developed.

ASP.NET is NOT ASP

ASP.NET is the next generation ASP, but it's not an upgraded version of ASP. ASP.NET is an entirely new technology for server-side scripting. It was written from the ground up and is not backward compatible with classic ASP. You can read more about the differences between ASP and ASP.NET in the next chapter of this tutorial. ASP.NET is the major part of the Microsoft's .NET Framework.

Dynamic Page in ASP .NET


<html> <body bgcolor="yellow"> <center> <h2>ASP.NET</h2> <p><%Response.Write(now())%></p> </center> </body> </html>

ASP.NET - Server Controls

Server controls are tags that are understood by the server. There are three kinds of server controls:

HTML Server Controls - Traditional HTML tags Web Server Controls - New ASP.NET tags Validation Server Controls - For input validation

HTML Server Controls are HTML tags understood by the server.

HTML elements in ASP.NET files are, by default, treated as text. To make these elements programmable, add a runat="server" attribute to the HTML element. This attribute indicates that the element should be treated as a server control. The id attribute is added to identify the server control. The id reference can be used to manipulate the server control at run time.

example...
<script runat="server"> Sub Page_Load link1.HRef = "javascript:alert('Link Clicked')" End Sub </script> <html> <body> <form id="Form1" runat="server"> <a id="link1" runat="server">CLICK ME</a> </form> </body> </html>

ASP.NET - Web Server Controls

ASP.NET - Web Server Controls Web server controls are special ASP.NET tags understood by the server. Like HTML server controls, Web server controls are also created on the server and they require a runat="server" attribute to work. However, Web server controls do not necessarily map to any existing HTML elements and they may represent more complex elements. The syntax for creating a Web server control is:

<asp:control_name id="some_id" runat="server" />

example...
<script runat="server"> Sub submit(Source As Object, e As EventArgs) button1.Text="You clicked me!" End Sub </script> <html> <body> <form id="Form1" runat="server"> <asp:Button id="button1" Text="Click me!" runat="server" OnClick="submit"/> </form> </body> </html>

ASP.NET - Validation Server Controls

Validation server controls are used to validate user-input. If the user-input does not pass validation, it will display an error message to the user.

Each validation control performs a specific type of validation (like validating against a specific value or a range of values).

By default, page validation is performed when a Button, ImageButton, or LinkButton control is clicked. You can prevent validation when a button control is clicked by setting the CausesValidation property to false.

The syntax for creating a Validation server control is:

example...
<html> <body> <form id="Form1" runat="server"> <p>Enter a number from 1 to 100: <asp:TextBox id="tbox1" runat="server" /> <br /><br /> <asp:Button ID="Button1" Text="Submit" runat="server" /> </p> <p> <asp:RangeValidator ID="RangeValidator1" ControlToValidate="tbox1" MinimumValue="1" MaximumValue="100" Type="Integer" Text="The value must be from 1 to 100!" runat="server" /> </p> </form> </body> </html>

You might also like