Hi,
in your example you call 2 times the same method
I will try to make a simple example where calling two
different methods and two different callback in sequence
Thanks
Michael Schwarz wrote:
> Hi,
>
> I have done this example to run two methods at the same time:
>
>
> <%@ Page language="c#" Inherits="System.Web.UI.Page"
> ClassName="ExamplePerformance" %>
> <script language="c#" runat="server">
>
> [AjaxPro.AjaxMethod]
> public string Test02(int a, bool b, string s)
> {
> System.Threading.Thread.Sleep(2*1000);
> return "Hello World!";
> }
>
> public void Page_Load(object sender, EventArgs e)
> {
> AjaxPro.Utility.RegisterTypeForAjax(typeof(ExamplePerformance));
> }
>
> </script>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title>Example</title>
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
> </head>
> <body>
> <form id="Form1" method="post" runat="server">
>
> <script type="text/javascript">
>
> function callback(res) {
> alert(AjaxPro.toJSON(res));
> }
>
> ASP.ExamplePerformance.Test02(1, true, "Hello World", callback);
> ASP.ExamplePerformance.Test02(1, true, "Hello World", callback);
>
> </script>
>
> </form>
> </body>
> </html>
>
>
>
> This example is working for me, so maybe I have time this evening to
> look on your code.
>
> Regards,
> Michael
>
>
>
>
>
>
> On 5/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> > Hi
> > I used ajax with asp.net 1.1 and made the following
> > javascript code that worked very well.
> > (I translated some variables, originally italian style in English.)
> >
> > When i used the same code in ASP.NET 2.0 with relative new AJAXPRO
> > only worked either
> > County.ReturnDataTableCounty(province,page,test15_callback) or
> > County.ReturnRecordNumber(province,test16_callback), but not both at
> > the same time.
> > Is there anybody that can helpme?
> > best regards and thanx
> >
> >
> >
> > function LoadCounty(dropdownlist1){
> > //alert('called');
> > var countryId=dropdownlist1.selectedIndex;
> > var province=dropdownlist1.options(parseInt(countryId)).text;
> > var page=parseInt(Form1.txtCurrentPage.value);
> > if (countryId > 0)
> > {
> > //alert('return');
> > County.ReturnDataTableCounty(province,page,test15_callback);
> > County.ReturnRecordNumber(province,text16_callback);
> > }
> >
> > }
> >
> > function test15_callback(res){
> > var dt= res.value;
> > var page=parseInt(Form1.txtCurrentPage.value);
> > var mPage="&Page=" +page;
> > var event="";
> > tableDisplay.innerHTML="";
> > if(typeof(res) == 'object' && typeof(dt) == 'object'){
> > var s = new Array();
> > s[s.length]="<table cellPadding=1 cellSpacing=1 rules=rows
> > border=1>";
> > s[s.length]="<tr style=background-color:Lightgreen
> > ;font-size:X-Small;>";
> >
> > s[s.length]="<td
> > style=width:150px>Description</td><td>Delete</td><td>Modify</td></tr>";
> >
> > for(var i=0; i<dt.Tables[0].Rows.length; i++){
> > s[s.length]="<tr style=font-size:X-Small;>";
> >
> > s[s.length]="<td style=width:150px;>" +
> > dt.Tables[0].Rows[i].descrizione + "</td>";
> >
> > //
> >
> > s[s.length]="<td align=center>" + "<a
> > HREF=County.aspx?Delete=1&id="
> > + dt.Tables[0].Rows[i].id_tipocomune + "&idProvincia=" +
> > dt.Tables[0].Rows[i].id_regione + mPage + "><img src=images/trash.gif
> > alt='' border=0 style=font-size:Small></A></td>";
> > s[s.length]="<td align=center>" + "<a
> > HREF=County.aspx?Edit=1&id=" +
> > dt.Tables[0].Rows[i].id_tipocomune + "&idProvincia=" +
> > dt.Tables[0].Rows[i].id_regione + mPage + ">Go!</A></td>";
> > s[s.length]="<tr>";
> > }
> > s[s.length]="</table>";
> > tableDisplay.innerHTML=s.join("");
> > }
> >
> > }
> > function test16_callback(res){
> > //
> > Form1.txtNoComuni.value=res.value;
> > var PageCount;
> > PageCount=Math.ceil(res.value/5);
> > var s="";
> > if (0==PageCount){
> > pager.innerHTML=s ;
> > return;
> > }
> > pager.innerHTML=s ;
> > var CurrentPage;
> > CurrentPage=parseInt(Form1.txtCurrentPage.value);
> > if (CurrentPage>1)
> > s= s + SinglePage(CurrentPage -
> > 1,"<b><<</b>","County.aspx");
> > //le altre pagine
> > for (var i = 0; i<PageCount; i++){
> > s= s + SinglePage(i+1, "","County.aspx");
> > }
> > if (CurrentPage < PageCount)
> > s=s+ SinglePage(CurrentPage + 1,
> > "<b>>></b>","County.aspx");
> > pager.innerHTML=s ;
> > }
> >
> > function SinglePage(Page,Text,Url){
> > if (Text == "")
> > Text = Page;
> > var ThePage;
> > ThePage = "?Page=" + Page;
> > var CurrentPage;
> > CurrentPage=Form1.txtCurrentPage.value;
> > var TheRegion;
> > TheRegion="&Regione=" + document.Form1.regioni.value;
> > TheRegion=TheRegion.replace(" ","%20")
> > var TheProvince;
> > TheProvince="&Provincia=" + document.Form1.provincie.value;
> > TheProvince=TheProvince.replace(" ","%20")
> > if (CurrentPage == Page)
> > return "<b>[" + Page + "]</b>";
> > else
> > return " <a id=" + "A" + Page + " href=" + Url + ThePage +
> > TheRegion + TheProvince + ">" + Text + "</a>";
> > }
> >
> >
> > >
> >
>
>
> --
> Best regards | Sch?Gr?t; Michael
>
> Microsoft MVP - Most Valuable Professional
> Microsoft MCAD - Certified Application Developer
>
> http://weblogs.asp.net/mschwarz/
> http://www.schwarz-interactive.de/
> mailto:[EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info
-~----------~----~----~----~------~----~------~--~---