This is a migrated thread and some comments may be shown as answers.

AjaxRequest Error

1 Answer 64 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
gila
Top achievements
Rank 1
gila asked on 18 Jan 2011, 08:15 AM
Hello,
In my solution i have master page which contains :
<telerik:RadScriptManager ID="MasterScriptManager" runat="server" EnablePageMethods="true">
</telerik:RadScriptManager><telerik:RadAjaxManager ID="MasterAjaxManager" runat="server" />
<telerik:RadWindowManager ID="MasterWindowManager" runat="server">....
In one of my pages , on button client click i call a js function, showing radconfirm, after the user enter YES i get in other js function and call :
"$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("FINISH");"
In the code behind of the page , on pageLoad i delegate the event of the ajaxrequest:
"var manager = RadAjaxManager.GetCurrent(this);
manager.AjaxRequest +=
new RadAjaxControl.AjaxRequestDelegate(YourContentPage_AjaxRequest);"
, and in the event i make swith case on the parameter i send:
//Handle the Ajax event in your ContentPage code behind
private void YourContentPage_AjaxRequest(object sender, AjaxRequestEventArgs e){
//Optionally process supplied event arg
switch (e.Argument)
{
case "FINISH": //Do something
btnFinish_Click(null, null);
break;
}
}

The problem is:
first click on the button everything works - see the radconfirm, answer yes, get in the server event. but second click on the button happens: see the radconfirm, get in the function, doing the statement of the "find" above, i see that it isnot null, but hte somewhere it falls with this bug:
"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
".

Needs urgent help,
thanks,
gz

1 Answer, 1 is accepted

Sort by
0
Mira
Telerik team
answered on 20 Jan 2011, 02:35 PM
Hello Gila,

I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.

Please take a look at it and let me know whether it helps.

Greetings,
Mira
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Ajax
Asked by
gila
Top achievements
Rank 1
Answers by
Mira
Telerik team
Share this question
or