Sunday, January 5, 2014

ASP NET 4 BASICS USING VISUAL STUDIO 2012 Part 5 (Form Objects)


---
ASP NET 4 BASICS USING VISUAL STUDIO 2012 Part 5 (Form Objects)

STEPS

1) Create New Web Site.
2) New Web Site options.
1. Template Language: Visual Basic.
2. .Net Framework: 4
3. Template Types: ASP.NET Empty Web Site
4. File Location: File System
5. Path: C:\projects\vs12vb\sitevb201
2) Add a Web Form.
1. Language: Visual Basic.
2. Type: Web Form
3. Name: Default.aspx
4. Place code in separate file (No), Select Master page (No)
3) Edit Default.aspx
Open Default.aspx.
Switch to Source mode.
Add <p> elements for 6 times.
4) Add form objects.
Switch to Design mode.
Drag and drop Label, TextBox, DropDown and Button objects as follows:
Switch to Source mode.
Your form codes should look like below:
5) Modify the form texts to make them more meaningful.
6) Run.
7) Add JavaScript for Reset Button.
We can add a client-side scripting such as JavaScript to reset form values.
Modify the Button2 properties as follows:
8) Run.
Perform the following steps:
1. Enter…
Name: John
DOB: 1/1/2000
Age Now: 14
2. Click Reset.
3. Re-enter the same data.
4. Click Submit. Observe the “View State” effect.
5. Click Reset.The values do not reset to blank. Instead, they remain as entered earlier.
6. Click Refresh button (in Web Browser’s tool bar). Observe the “View State” effect.
7. Click the URL in the Address Box and press Enter. The TextBox objects now reset to blank values.
---

No comments:

Post a Comment