Asp.Net with Vb.Net
Essay by review • February 6, 2011 • Study Guide • 2,399 Words (10 Pages) • 1,505 Views
ASP.NET with VB.NET
* What is ASP.NET?
ASP.NET is server side scripting technologies that enable scripts to server executed by internet
* Standard for Active Server Pages
* Can be run inside (IIS)(Internet Information Services)
* ASP.NET file is just the same as HTML File
* ASP.NET can contain HTML Jscript, VB script, XML script, C# script
* File extension .aspx
* ASP.NET 2005 version 2.0
* Client(web browser )  Internet  Server(web server, asp server)
* You can create & run your website in one of 3 location:
1. Your own computer(local files system)
2. HTTP server that contain (IIS)
3. FTP site
General code:
Page1
* To link pages we must to define button to review it in related label in the other page using session" result "= result
* To link pages (1) from prop. Post back (2) Response.redirect"pagename.aspx"
Project1: make Calculator
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button5_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
End Sub
Public num1, num2, result As Integer
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
num1 = TextBox1.Text
num2 = TextBox2.Text
result = num1 + num2
TextBox3.Text = result
Session("result") = result
End Sub
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles LinkButton1.Click
Response.Redirect("result.aspx")
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
num1 = TextBox1.Text
num2 = TextBox2.Text
result = num1 - num2
TextBox3.Text = result
Session("result") = result
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
num1 = TextBox1.Text
num2 = TextBox2.Text
result = num1 * num2
TextBox3.Text = result
Session("result") = result
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
num1 = TextBox1.Text
num2 = TextBox2.Text
result = num1 / num2
TextBox3.Text = result
Session("result") = result
End Sub
End Class
Partial Class Default2
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Label2.Text = Session("result")
End Sub
End Class
Project 2: create Email website:
Sign In page Code:
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = Session("UserID") And TextBox2.Text = Session("password") Then
Response.Redirect("welcome.aspx")
Else
...
...