|
July 31, 2002 The onclick Event Handler Tips: July 2002
Yehuda Shiran, Ph.D.
|
|
When consuming the add Web service, we call the JScript .NET function, Submit_Click(). It is the event handler of the ASP:BUTTON control. Here is the code:
We define an object webService of the simpleCalc class. The class simpleCalc is the Web service class, and is stored in the simpleCalc namespace of the .NET framework. We call the Web service by calling the add() method of the object webService. We pass the two input integer numbers to add(). The value of the ASP:TEXTBOX control is its Text field. Therefore, the two input numbers are first.Text and second.Text. Since they are textual entries, we need to parse them as integer values by sending them to the method int.Parse().
The answer sent back by the Web service is stored in To learn more about JScript .NET and ASP.NET, go to Column 113, JScript .NET, Part VII: Consuming add from ASP.NET.
People who read this tip also read these tips: Look for similar tips by subject: |