|
July 28, 2002 Writing Web Forms Tips: July 2002
Yehuda Shiran, Ph.D.
|
|
An ASP.NET form that runs on a Web server is called an ASP.NET Web form, as opposed to the ASP.NET Windows form, used in Windows-based applications. Here is a form that calls the add Web service:
All tags include the RUNAT="server" parameter, directing the browser to run it on the Web server. The first tag is FORM. Its only parameter is RUNAT="server". By default, the server always posts the form back to the same originating page, simpleCalcConsumer.aspx. The Web form above includes three ASP:TEXTBOX tags. Here is the first one:
The parameters are straightforward. The ID parameter is used to reference the control from other places on the page such as event handlers. Notice we use the short-hand notation for closing tags. The first ASP:TEXTBOX tag's ID is first, the second is second, and the third is resultControl. The ASP:BUTTON tag is as follows:
The parameters are TEXT and ID. The TEXT parameter specifies the label of the button. We set it to "Add". Its ID is doAdd. In the event of a click, the function Submit_Click() is called.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: |