|2001347 (2001347) wrote,|
@ 2012-02-20 14:59:00
First, make certain you have AJAX Extension cables Installed. Give a Web Type in the web site
Then, you must add 'ScriptManager' handle to your net form Website Design Brisbane. Below, in the 'ScriptManager' marking, make 'EnablePageMethods' Equals 'true'
1) Get the value of 'firstNo' control
2) Get the value of 'secondNo' control
3) Call the Web method as: PageMethods Brisbane Website Design. GetSum(firstNo, secondNo, FillSumBox);
here 'FillSumBox' is the name of a function.
The actual function known as, CalcSum, is used for you to call your server part web strategy named 'GetSum'. 'GetSum' requires two details of kind int and its come back type is also int. Notice that I will be passing about three parameters called firstNo, secondNo and FillSumBox. Ok, here is a little trick, the very last parameter, in our scenario FillSumBox, is the title of the operate to which the world wide web method my partner and i.e. 'GetSum' can return the actual sum value. The parameter val involving function FillSumBox could eventually hold the returned sum integer. The typical syntax regarding calling net methods will be:
Now lug the following regulates on the aspx page:
1) or net:ScriptManager ID="ScriptManager1" EnablePageMethods="true"
2) or net:TextBox ID="txtFirstNo"
3) or net:TextBox ID="txtSecNo"
4) or net:TextBox ID="txtSum"
5) insight id="btnSum" type="button" onclick="CalcSum()" value="Calculate Sum"
Today lets look at your code at the rear of file. One thing to remember is perhaps all web solutions to be seen should be reported public noise.
making use of System.Web.Security;
making use of System.Net.UI;
using System.World wide web.UI.HtmlControls;
employing System.World wide web.UI.WebControls;