SELECT ASPX <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default.aspx.vb" Inherits ="_Default" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > </ head > < body > < form id ="form1" runat ="server"> < div > < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < asp : DataGrid ID ="DataGrid" runat ="server" CellPadding ="4" ForeColor ="#333333" GridLines ="None"> < AlternatingItemStyle BackColor ="White" /> < EditItemStyle BackColor ="#7C6F57" /> < FooterStyle BackColor ="#1C5E55" Font - Bold ="True" ForeColor ="White" /> < HeaderStyle BackColor ="#1C5E55" Font - Bold ="True" ForeColor ="White" /> < ItemStyle BackColor ="#E3EAEB" /> < PagerStyle BackColor ="#666666" ForeColor ="White" HorizontalAlign ="Center" /> < SelectedItemStyle BackColor ="#C5BBAF" Font - Bold ="True" ForeColor ="#333333" /> </ asp : DataGrid > < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > ASPX.VB Imports System.Data Imports System.Data.OleDb Partial Class _Default Inherits System.Web.UI. Page Protected Sub Page_Load( ByVal sender As Object , ByVal e As System. EventArgs ) Handles Me .Load If Not IsPostBack Then Dim DBConn As OleDb. OleDbConnection Dim DBCommand As OleDb. OleDbDataAdapter Dim DSPageData As New DataSet DBConn = New OleDbConnection ( "Provider=Microsoft.jet.OLEDB.4.0;DATA SOURCE=D: \ db5.mdb" ) DBCommand = New OleDbDataAdapter ( "SELECT rollno,names1,m1,m2 from table1" , DBConn) DBCommand.Fill(DSPageData, "t1" ) DataGrid.DataSource = DSPageData.Tables( "t1" ).DefaultView DataGrid.DataBind() End If End Sub End Class DELETE ASPX <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default2.aspx.vb" Inherits ="Default2" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > < style type ="text/css"> #Text1 { height : 92px ; } </ style > </ head > < body > < form id ="form1" runat ="server"> < div > < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < asp : DataGrid ID ="DataGrid1" runat ="server" CellPadding ="4" ForeColor ="#333333" GridLines ="None"> < AlternatingItemStyle BackColor ="White" /> < FooterStyle BackColor ="#990000" Font - Bold ="True" ForeColor ="White" /> < HeaderStyle BackColor ="#990000" Font - Bold ="True" ForeColor ="White" /> < ItemStyle BackColor ="#FFFBD6" ForeColor ="#333333" /> < PagerStyle BackColor ="#FFCC66" ForeColor ="#333333" HorizontalAlign ="Center" /> < SelectedItemStyle BackColor ="#FFCC66" Font - Bold ="True" ForeColor ="Navy" /> </ asp : DataGrid > < br /> < br /> < br /> < asp : Button ID ="Button1" runat ="server" Text ="submit" /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > ASPX.VB Imports System.Data Imports System.Data.OleDb Partial Class Default2 Inherits System.Web.UI. Page Protected Sub Button1_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles Button1.Click Dim DBConn As OleDb. OleDbConnection Dim DBcommand As New OleDb. OleDbDataAdapter Dim DBDelete As New OleDb. OleDbCommand DBConn = New OleDbConnection ( "Provider=Microsoft.jet.OLEDB.4.0;DATA SOURCE=D: \ db5.mdb" ) DBDelete.CommandText = "Delete from Table1 where rollno=3" DBDelete.Connection = DBConn DBDelete.Connection.Open() DBDelete.ExecuteNonQuery() End Sub End Class INSERT ASPX <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default3.aspx.vb" Inherits ="Default3" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > </ head > < body > < form id ="form1" runat ="server"> < div > < asp : TextBox ID ="txtrollno" runat ="server" style =" z - index : 1; left : 12px; top : 22px; position : absolute"></ asp : TextBox > < br /> < br /> < br /> < asp : TextBox ID ="txtnm" runat ="server" style =" z - index : 1; left : 186px; top : 20px; position : absolute"></ asp : TextBox > < br /> < asp : Button ID ="Button1" runat ="server" style =" z - index : 1; left : 671px; top : 15px; position : absolute" Text ="Add" /> < br /> < br /> < asp : TextBox ID ="txtm1" runat ="server" style =" z - index : 1; left : 354px; top : 19px; position : absolute"></ asp : TextBox > < br /> < br /> < br /> < br /> < asp : TextBox ID ="txtm2" runat ="server" style =" z - index : 1; left : 512px; top : 19px; position : absolute"></ asp : TextBox > < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > ASPX.VB Imports System.Data Imports System.Data.OleDb Partial Class Default3 Inherits System.Web.UI. Page Protected Sub Button1_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles Button1.Click Dim DBConn As OleDb. OleDbConnection Dim DBInsert As New OleDb. OleDbCommand DBConn = New OleDbConnection ( "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=D: \ db5.mdb" ) Response.Write(txtnm.Text) DBInsert.CommandText = "Insert into Table1(rollno,names1,m1,m2) values(?,?,?,?)" DBInsert.Parameters.AddWithValue( "?" , Val(txtrollno.Text)) DBInsert.Parameters.AddWithValue( "?" , txtnm.Text) DBInsert.Parameters.AddWithValue( "?" , Val(txtm1.Text)) DBInsert.Parameters.AddWithValue( "?" , Val(txtm2.Text)) DBInsert.Connection = DBConn DBInsert.Connection.Open() DBInsert.ExecuteNonQuery() DBConn.Close() End Sub End Class UPDATE ASPX <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default4.aspx.vb" Inherits ="Default4" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > </ head > < body > < form id ="form1" runat ="server"> < div > < asp : TextBox ID ="txtroll" runat ="server"></ asp : TextBox > < asp : TextBox ID ="txtnm" runat ="server"></ asp : TextBox > < asp : TextBox ID ="txtm1" runat ="server"></ asp : TextBox > < asp : TextBox ID ="txtm2" runat ="server"></ asp : TextBox > < asp : Button ID ="Button1" runat ="server" Text ="SELECT" /> < asp : Button ID ="Button2" runat ="server" style =" z - index : 1; left : 596px; top : 14px; position : absolute" Text ="UPDATE" /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > ASPX.VB Imports System.Data Imports System.Data.OleDb Partial Class Default4 Inherits System.Web.UI. Page Protected Sub Button1_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles Button1.Click Dim DBConn As OleDb. OleDbConnection Dim DBcommand As New OleDb. OleDbDataAdapter Dim DSPageData As New DataSet DBConn = New OleDbConnection ( "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=D: \ db5.mdb" ) DBcommand = New OleDbDataAdapter ( "SELECT rollno,names1,m1,m2 from table1 WHERE rollno = " & Val(txtroll.Text), DBConn) DBcommand.Fill(DSPageData, "t2" ) txtroll.Text = DSPageData.Tables( "t2" ).Rows(0).Item( "rollno" ) txtnm.Text = DSPageData.Tables( "t2" ).Rows(0).Item( "names1" ) txtm1.Text = DSPageData.Tables( "t2" ).Rows(0).Item( "m1" ) txtm2.Text = DSPageData.Tables( "t2" ).Rows(0).Item( "m2" ) DBConn.Close() End Sub Protected Sub Button2_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles Button2.Click Dim DBConn As OleDb. OleDbConnection Dim DBUpdate As New OleDb. OleDbCommand DBConn = New OleDbConnection ( "Provider=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=D: \ db5.mdb" ) Response.Write(txtnm.Text) DBUpdate.CommandText = "update table1 set names1=?,m1=?,m2=? where rollno=?" DBUpdate.Parameters.AddWithValue( "?" , txtnm.Text) DBUpdate.Parameters.AddWithValue( "?" , Val(txtm1.Text)) DBUpdate.Parameters.AddWithValue( "?" , Val(txtm2.Text)) DBUpdate.Parameters.AddWithValue( "?" , Val(txtroll.Text)) DBUpdate.Connection = DBConn DBUpdate.Connection.Open() DBUpdate.ExecuteNonQuery() DBConn.Close() End Sub End Class VALIDATION CONTROL: ASPX: <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Validation_control.aspx.vb" Inherits ="Validation_control" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > </ head > < body > < form id ="form1" runat ="server"> < div > < asp : TextBox ID ="txtName" runat ="server" style =" z - index : 1; left : 71px; top : 16px; position : absolute"></ asp : TextBox > < br /> NAME: < asp : RequiredFieldValidator ID ="RequiredFieldValidator1" runat ="server" ControlToValidate ="txtName" ErrorMessage ="Name is required" ForeColor ="Red" style =" z - index : 1; left : 348px; top : 18px; position : absolute; margin - top : 0px"></ asp : RequiredFieldValidator > < br /> < br /> < asp : RangeValidator ID ="RangeValidator1" runat ="server" ControlToValidate ="txtAge" ErrorMessage ="Age must be between 18 to 50" ForeColor ="Red" MaximumValue ="50" MinimumValue ="18" style =" z - index : 1; left : 351px; top : 65px; position : absolute"></ asp : RangeValidator > < br /> < asp : TextBox ID ="txtAge" runat ="server" style =" z - index : 1; left : 72px; top : 69px; position : absolute"></ asp : TextBox > AGE: < br /> < br /> < asp : TextBox ID ="txtEmail" runat ="server" style =" z - index : 1; left : 72px; top : 127px; position : absolute"></ asp : TextBox > < br /> EMAIL: < br /> < br /> < asp : RequiredFieldValidator ID ="RequiredFieldValidator2" runat ="server" ControlToValidate ="txtPassword" ErrorMessage ="Password is required" ForeColor ="Red" style =" z - index : 1; left : 332px; top : 205px; position : absolute"></ asp : RequiredFieldValidator > < br /> < asp : TextBox ID ="txtPassword" runat ="server" style =" z - index : 1; left : 106px; top : 205px; position : absolute"></ asp : TextBox > PASSWORD: < br /> < br /> < br /> < asp : CompareValidator ID ="CompareValidator1" runat ="server" ErrorMessage ="Password do not match" ForeColor ="Red" style =" z - index : 1; left : 345px; top : 279px; position : absolute"></ asp : CompareValidator > < br /> < asp : TextBox ID ="TextBox2" runat ="server" style =" z - index : 1; top : 284px; position : absolute; left : 184px; height : 18px"></ asp : TextBox > CONFIRM PASSWORD: < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > Validation control: <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default.aspx.vb" Inherits ="_Default" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > </ head > < body > < form id ="form1" runat ="server"> < div > < asp : Label ID ="Label1" runat ="server" Text ="Age"></ asp : Label > < br /> < br /> < asp : RangeValidator ID ="RangeValidator1" runat ="server" ControlToValidate ="TextBox1" ErrorMessage ="Age must be between 18 to 50" ForeColor ="Red" MaximumValue ="50" MinimumValue ="18" style =" z - index : 1; left : 173px; top : 61px; position : absolute; bottom : 399px" Type ="Integer"></ asp : RangeValidator > < br /> < asp : TextBox ID ="TextBox1" runat ="server" style =" z - index : 1; left : 11px; top : 61px; position : absolute"></ asp : TextBox > < br /> < br /> < br /> < asp : Label ID ="Label2" runat ="server" Text ="email"></ asp : Label > < br /> < br /> < br /> < asp : TextBox ID ="TextBox2" runat ="server"></ asp : TextBox > < br /> < br /> < br /> < asp : RegularExpressionValidator ID ="RegularExpressionValidator1" runat ="server" ControlToValidate ="TextBox2" ErrorMessage ="Invalid email" ForeColor ="Red" style =" z - index : 1; left : 180px; top : 186px; position : absolute" ValidationExpression =" \ w+@ \ w+ \ \ w+"></ asp : RegularExpressionValidator > < br /> < br /> < br /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > Custom validator (to check even or odd number): Validation control full along with vb <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default.aspx.vb" Inherits ="_Default" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head id ="Head1" runat ="server"> < title > ASP.NET Validation Example </ title > </ head > < body > < form id ="form1" runat ="server"> < div > < br /> < br /> < br /> < br /> < br /> < asp : RangeValidator ID ="RangeValidator1" runat ="server" ControlToValidate ="TextBox1" ErrorMessage ="age is between 18 to 50" ForeColor ="Red" MaximumValue ="50" MinimumValue ="18" style =" z - index : 1; left : 394px; top : 102px; position : absolute; width : 145px" Type ="Integer"></ asp : RangeValidator > < asp : TextBox ID ="TextBox1" runat ="server" style =" z - index : 1; left : 192px; top : 102px; position : absolute"></ asp : TextBox > < br /> < asp : Label ID ="Label5" runat ="server" style =" z - index : 1; left : 116px; top : 239px; position : absolute" Text ="password"></ asp : Label > < asp : TextBox ID ="TextBox5" runat ="server" TextMode ="Password" style =" z - index : 1; left : 201px; top : 244px; position : absolute"></ asp : TextBox > < br /> < asp : Label ID ="Label1" runat ="server" style =" z - index : 1; left : 118px; top : 100px; position : absolute" Text ="age"></ asp : Label > < br /> < br /> < asp : TextBox ID ="TextBox2" runat ="server" style =" z - index : 1; left : 187px; top : 147px; position : absolute"></ asp : TextBox > < asp : RegularExpressionValidator ID ="RegularExpressionValidator1" runat ="server" ControlToValidate ="TextBox2" ErrorMessage ="invalid email" ForeColor ="Red" style =" z - index : 1; left : 395px; top : 153px; position : absolute" ValidationExpression =" \ w+@ \ w+ \ \ w+"></ asp : RegularExpressionValidator > < br /> < asp : Label ID ="Label2" runat ="server" style =" z - index : 1; left : 112px; top : 149px; position : absolute" Text ="Email"></ asp : Label > < asp : CustomValidator ID ="cvNumber" runat ="server" ControlToValidate ="TextBox3" ErrorMessage ="enter even number" ForeColor ="Red" style =" z - index : 1; left : 385px; top : 196px; position : absolute" OnServerValidate ="cvNumber_ServerValidate"></ asp : CustomValidator > < asp : TextBox ID ="TextBox3" runat ="server" style =" z - index : 1; left : 187px; top : 192px; position : absolute"></ asp : TextBox > < asp : Label ID ="Label3" runat ="server" style =" z - index : 1; left : 109px; top : 197px; position : absolute; height : 18px" Text ="Number"></ asp : Label > < br /> < br /> < br /> < asp : RequiredFieldValidator ID ="RequiredFieldValidator1" runat ="server" ControlToValidate ="TextBox4" ErrorMessage ="name is required" ForeColor ="Red" style =" z - index : 1; left : 378px; top : 65px; position : absolute"></ asp : RequiredFieldValidator > < asp : TextBox ID ="TextBox4" runat ="server" style =" z - index : 1; left : 194px; top : 56px; position : absolute"></ asp : TextBox > < asp : Label ID ="Label4" runat ="server" style =" z - index : 1; left : 115px; top : 60px; position : absolute" Text ="Name"></ asp : Label > < br /> < br /> <! -- Fixed CompareValidator checking TextBox6 (Confirm) against TextBox5 (Password) -- > < asp : CompareValidator ID ="CompareValidator2" runat ="server" ControlToCompare ="TextBox5" ControlToValidate ="TextBox6" Operator ="Equal" ErrorMessage ="password do not match" ForeColor ="Red" style =" z - index : 1; left : 376px; top : 275px; position : absolute"></ asp : CompareValidator > < asp : Button ID ="Button1" runat ="server" style =" z - index : 1; left : 535px; top : 192px; position : absolute" Text ="Button" /> < asp : Label ID ="Label6" runat ="server" style =" z - index : 1; left : 67px; top : 281px; position : absolute" Text ="confirmed password"></ asp : Label > < asp : TextBox ID ="TextBox6" runat ="server" TextMode ="Password" style =" z - index : 1; left : 207px; top : 293px; position : absolute"></ asp : TextBox > < br /> </ div > </ form > </ body > </ html > ASPX.VB Partial Class _Default Inherits System.Web.UI. Page Protected Sub cvNumber_ServerValidate( ByVal source As Object , ByVal args As System.Web.UI.WebControls. ServerValidateEventArgs ) Handles cvNumber.ServerValidate If Val(TextBox3.Text) Mod 2 = 0 Then args.IsValid = True Else args.IsValid = False End If End Sub Protected Sub Button1_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles Button1.Click If Page.IsValid Then Response.Write( "validation successfull" ) End If End Sub End Class Webservice Calculator Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols ' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. ' <System.Web.Script.Services.ScriptService()> _ < WebService (Namespace:= "http://tempuri.org/" )> _ < WebServiceBinding (ConformsTo:= WsiProfiles .BasicProfile1_1)> _ < Global .Microsoft.VisualBasic.CompilerServices. DesignerGenerated ()> _ Public Class WebService Inherits System.Web.Services. WebService < WebMethod ()> _ Public Function HelloWorld() As String Return "hello world" End Function < WebMethod ()> _ Public Function Add( ByVal a As Integer , ByVal b As Integer ) As Integer Return a + b End Function < WebMethod ()> _ Public Function Subtr( ByVal a As Integer , ByVal b As Integer ) As Integer Return a - b End Function < WebMethod ()> _ Public Function Mul( ByVal a As Integer , ByVal b As Integer ) As Integer Return a * b End Function < WebMethod ()> _ Public Function Div( ByVal a As Integer , ByVal b As Integer ) As Integer Return a / b End Function < WebMethod ()> _ Public Function Clear() As String Return " " End Function End Class Port http://localhost:18251/WebSite13/WebService.asmx?WSDL In order to get calculator_ws in website add service reference - advanced - add web reference - paste url - and then green symbol and give reference name ..so that it will be created and this will be used in default.vb....be careful with.asmx name...don’t rename anyth ing.... DEFAULT: <% @ Page Language ="VB" AutoEventWireup ="false" CodeFile ="Default.aspx.vb" Inherits ="_Default" %> <! DOCTYPE html PUBLIC " - //W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1 - transitional.dtd"> < html xmlns ="http://www.w3.org/1999/xhtml"> < head runat ="server"> < title ></ title > </ head > < body > < form id ="form1" runat ="server"> < div > < br /> < asp : TextBox ID ="TextBox1" runat ="server"></ asp : TextBox > < asp : TextBox ID ="TextBox2" runat ="server" style =" z - index : 1; left : 15px; top : 145px; position : absolute; bottom : 323px"></ asp : TextBox > < asp : Label ID ="Label1" runat ="server" style =" z - index : 1; left : 166px; top : 32px; position : absolute; height : 28px" Text ="FIRST NUMBER"></ asp : Label > < br /> < br /> < br /> < br /> < asp : Label ID ="Label2" runat ="server" style =" z - index : 1; left : 187px; top : 86px; position : absolute" Text ="SECOND NUMBER"></ asp : Label > < br /> < br /> < br /> < br /> < br /> < asp : TextBox ID ="TextBox3" runat ="server" style =" z - index : 1; left : 11px; top : 85px; position : absolute"></ asp : TextBox > < asp : Label ID ="Label3" runat ="server" style =" z - index : 1; left : 193px; top : 145px; position : absolute" Text ="RESULT"></ asp : Label > < asp : Button ID ="btnADD" runat ="server" Text ="+" /> < br /> < br /> < br /> < asp : Button ID ="btnDIFF" runat ="server" style =" z - index : 1; left : 90px; top : 205px; position : absolute" Text =" - " /> < br /> < br /> < br /> < asp : Button ID ="btnMUL" runat ="server" style =" z - index : 1; left : 174px; top : 208px; position : absolute; bottom : 318px" Text ="*" /> < br /> < br /> < br /> < asp : Button ID ="btnDIV" runat ="server" style =" z - index : 1; left : 257px; top : 207px; position : absolute" Text ="/" /> < br /> < br /> < asp : Button ID ="btnCLEAR" runat ="server" style =" z - index : 1; left : 350px; top : 206px; position : absolute" Text ="CLEAR" /> < br /> < br /> < br /> </ div > </ form > </ body > </ html > DEFAULT.ASPX.VB Partial Class _Default Inherits System.Web.UI. Page Protected Sub btnADD_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles btnADD.Click Dim cal As New CALCULATOR_WS. WebService () TextBox2.Text = cal.Add(Val(TextBox1.Text), Val(TextBox3.Text)) End Sub Protected Sub btnDIFF_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles btnDIFF.Click Dim cal As New CALCULATOR_WS. WebService () TextBox2.Text = cal.Subtr(Val(TextBox1.Text), Val(TextBox3.Text)) End Sub Protected Sub btnMUL_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles btnMUL.Click Dim cal As New CALCULATOR_WS. WebService () TextBox2.Text = cal.Mul(Val(TextBox1.Text), Val(TextBox3.Text)) End Sub Protected Sub btnDIV_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles btnDIV.Click Dim cal As New CALCULATOR_WS. WebService () TextBox2.Text = cal.Div(Val(TextBox1.Text), Val(TextBox3.Text)) End Sub Protected Sub btnCLEAR_Click( ByVal sender As Object , ByVal e As System. EventArgs ) Handles btnCLEAR.Click Dim cal As New CALCULATOR_WS. WebService () TextBox1.Text = cal.Clear() TextBox3.Text = cal.Clear() TextBox2.Text = cal.Clear() End Sub End Class WEBSERVICE.ASMX <% @ WebService Language ="VB" CodeBehind ="~/App_Code/WebService.vb" Class ="WebService" %> OUTPUT: