Download presentation
Presentation is loading. Please wait.
Published byRafe Richardson Modified over 9 years ago
1
ASP Hello, world
2
ServerClient Response Request
3
A form
4
System.Web.UI.Page void SubmitBtn_Click(Object sender, EventArgs e) { Message.Text = "The text is " + Name.Text; }
5
LIST void SubmitBtn_Click(Object sender, EventArgs e) { Message.Text = "The text is " + Key.SelectedItem; } 2010 2009 2008
6
IF void SubmitBtn_Click(Object sender, EventArgs e) { if (Key.SelectedValue == "2000") { Message.Text = "two thousand"; } else { Message.Text = "another number"; } }
7
Case Switch(x) { Case 1: y=1; break; Case 2: y=2; break; default: y=0; break; }
8
Cycles While (x<10){ } Do { } while (x<10) For
9
Web forms vs Windows forms vs Example private void MyFunction() { Response.Write("I work "); }
10
Sending user data to the server All the data on button click Piece by piece (for each interface element) Example: void ch(Object sender, EventArgs e) { Response.Write("I work "); }
11
Using buttons void WBC(Object sender, EventArgs e) { Response.Write("Button clicked"); }
12
Defining HTML Events (not good style) void HTML(Object sender, EventArgs e) { Response.Write("I am HTML event"); }
13
assignment ! CheckBox, Radio Button, RadioButtonList
14
Table void ok(Object sender, EventArgs e) { table1.Border = 4; table1.BorderColor = "Red"; table1.Height = "100%"; } 1 2
15
Page_Init and page_Load void Page_Load(Object sender, EventArgs e) { Response.Write("I am loading "); } Write similar for Page_Init and Page_Unload
16
If the pages loads for the first time? (needs several pages) void Page_Load(Object sender, EventArgs e) { If (Page.IsPostBack==false) { Response.Write("I am loading "); } else Response.Write(“2 nd time”); }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.