|
August 5, 2002 Writing IsPrime's Consumer in ASP.NET Tips: August 2002
Yehuda Shiran, Ph.D.
|
|
The following code is the BODY section of the ASP.NET page that consumes the IsPrime 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, isPrimeConsumer.aspx. Since this form runs on the server, it is called the ASP.NET Web form, as opposed to the ASP.NET Windows form, used in Windows-based applications.
The Web form above includes a single
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
The button is implemented with the ASP:BUTTON tag:
The parameters are TEXT and ID. The TEXT parameter specifies the label of the button. We set it to "Is Prime?". Its ID is isprime. In the event of a click, the function Submit_Click() is called.To learn more about JScript .NET and ASP.NET, go to Column 114, JScript .NET, Part VIII: Consuming IsPrime from ASP.NET.
People who read this tip also read these tips: Look for similar tips by subject: |