0% found this document useful (0 votes)
16 views

Web Tech Notes

This document provides examples of different ASP.NET server controls that can be used within a <form> tag including textboxes, buttons, validators, and labels. It also demonstrates how to add controls like textboxes, buttons, and labels in ASP.NET as well as how to add event handlers to buttons. The document ends by giving an example of how to create a basic ASP.NET page with a button and handler, add a master page to define common page elements, and use site maps to link individual pages.

Uploaded by

shazybaig
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Web Tech Notes

This document provides examples of different ASP.NET server controls that can be used within a <form> tag including textboxes, buttons, validators, and labels. It also demonstrates how to add controls like textboxes, buttons, and labels in ASP.NET as well as how to add event handlers to buttons. The document ends by giving an example of how to create a basic ASP.NET page with a button and handler, add a master page to define common page elements, and use site maps to link individual pages.

Uploaded by

shazybaig
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

All ASP.

NET server controls must appear within a <form> tag


A <form> tag must contain the runat="server" attribute (otherwise it
will be treated as a HTML form)

<H1> Headers
<P> Paragraph

<form runat="server">
Name: <asp:TextBox id="name" runat="server" />
<br>
Age: <asp:TextBox id="age" runat="server" />
<br><br>
<asp:Button runat="server" Text="Submit" />
<br><br>
<asp:RequiredFieldValidator
ControlToValidate="name"
Text="The name field is required!"
runat="server" />
</form>
This shows

Name:
Age:
Submit

</body>
</html>

User can add information from here such as username.


<input name="txbName" type="text" value="Enter your Username"
id="txbName" style="height: 25px; width: 238px" />

A password TextBox:
<asp:TextBox id="tb2" TextMode="password" runat="server" />
<br><br>

A TextBox with text:


<asp:TextBox id="tb3" Text="Hello World!" runat="server" />
<br><br>

HTML e.g
<input id =Button 1 type= button value=button/>
Standard- ASP e.g
Buttons <asp: button ID= Button2 runat =server Text=Button1/>
Label <asp: Label ID=example1 runat =server text=example12></asp:Label>
Text changes the name of the property.
E.g Button 1 into Button 2

ASP label has events with properties box for example events which is a lightening sign.
Double clicking button activates the handler, a handler allows you to program what the button will
do when a user clicks on it.
For example button2 . Text =hello
Page layout can be done via tables 3 rows 2 columns
Merge first and third cells by modify.
Master pages are used to define sections of website in one place.
Example ASP.NET Page
<html>
<body>
<form runat="server">
<asp:Button id="button1" Text="Click me!" OnClick="submit" runat="server" >
</form>
</body>
</html>
Add the master page, using the masterpage add the menu from navigation
Add each individual webform for the different pages e.g home contact us find us etc
Add the new data source this can be done by adding the root and the parent from menu and edit
menu, this is where u can add the different links to your page.

The site map allows you to link all pages with the masterpage this can be done by adding the url of
the aspx file e.g find us would be linked to the map, when the user clics find us they would be
directed to the map etc.

You might also like