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

JScript error on second Ajax postback

11 Answers 314 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Billy
Top achievements
Rank 1
Billy asked on 28 May 2009, 12:21 AM
Hi,

I am using a RadAjaxManager to update one RadComboBox based on a change in another RadComboBox.

On the first postback, everything works fine, but the second time I get a java script error.

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values."

The script has this header info...

/* START MicrosoftAjax.js */
//----------------------------------------------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------
// MicrosoftAjax.js

Here is the markup I'm using...

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server"/>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="cb1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="cb2" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        
            <table border="0" cellpadding="1" cellspacing="0" style="width: 100%; background-color: ButtonFace">
                <tr>
                    <td>
                        <label class="normtext">Agency</label>
                    </td>
                    <td style="width: 40%">
                        <telerik:RadComboBox ID="cb1" runat="server" 
                            EmptyMessage="No Agencies Assigned" HighlightTemplatedItems="True"
                            AllowCustomText="True" Skin="Hay" Width="90%" 
                            AutoPostBack="true">
                        </telerik:RadComboBox>
                    </td>
                    <td>
                        <label class="normtext">Branch</label>
                            
                    </td>
                    <td>
                        <telerik:RadComboBox ID="cb2" runat="server" 
                            EmptyMessage="N/A" HighlightTemplatedItems="true"
                            AllowCustomText="true" Enabled="false" Skin="Hay">
                            <ItemTemplate>
                                <asp:CheckBox runat="server" ID="chk1" Checked="true" onclick="onCheckBoxClick(this)"/>
                                <%#DataBinder.Eval(Container.DataItem, "BranchNameAndID")%>
                            </ItemTemplate>
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="normtext">Records Modified Between</label>
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="RDPStart" runat="server" Width="100">
                            <DatePopupButton Visible="true"></DatePopupButton>
                            <DateInput ID="DIStart" runat="server" onclick="ToggleFirstPopup()">
                            </DateInput>
                        </telerik:RadDatePicker>
                    </td>
                    <td>
                        <label class="normtext">And</label>
                    </td>
                    <td>
                        <telerik:RadDatePicker ID="RDPEnd" runat="server" Width="100">
                            <DatePopupButton Visible="true"></DatePopupButton>
                            <DateInput ID="DIEnd" runat="server" onclick="ToggleSecondPopup()">
                            </DateInput>
                        </telerik:RadDatePicker>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="normtext">Clinician Name</label>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtClinician"></asp:TextBox>
                    </td>
                    <td>
                        <label class="normtext">Patient Last Name</label>
                    </td>
                    <td>
                        <asp:TextBox runat="server" ID="txtPatient"></asp:TextBox>
                    </td>
                </tr>
            </table>

Please help!

Thanks,
Billy

11 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 29 May 2009, 08:26 AM
Hello Billy,

Could you please try disabling the ajax of the AjaxManager by setting its EnablaAjax property to false and check if you receive any server errors? Thus we are sure that the problem comes from RadAjax.

Best wishes,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Billy
Top achievements
Rank 1
answered on 29 May 2009, 05:12 PM
Thanks for your response.  

I restarted my machine, and can no longer reproduce the error.

Problem solved I guess.

Thanks,
Billy
0
Pavlina
Telerik team
answered on 01 Jun 2009, 06:31 AM
Hello Billy,

I am happy to hear that you no longer receive the error.
Do not hesitate to write if any issues arise.

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Avinash Kumar
Top achievements
Rank 1
answered on 20 Apr 2010, 04:43 PM
Hi,


I am using a RadTreeview inside a RadCombobox. I am calling a server side event to populate the commboboxText on "OnNodecheck". I do not want the whole page to reload, hence using the RadAjaxmanager.

Initially when i check a node the server method is getting called and is working fine,but when I check another node this error is getting thrown.

sys.webforms.pagerequestmanagerservererrorexception:Specified argument was out of range of valid values.

When i made EnableAJAX="false" it is working properly.

Please need some advice.

Thanks,
Avinash
0
Avinash Kumar
Top achievements
Rank 1
answered on 22 Apr 2010, 06:20 AM
Waiting for some help :( !!

Thanks,
Avinash
0
Pavlina
Telerik team
answered on 22 Apr 2010, 02:34 PM
Hi Avinash,

Based on the provided information it is hard to determine the exact cause for the error you are getting. Can you please provide me with the markup of the problematic page and any related JavaScript and/or server-side code?

Kind regards,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Megan Vee
Top achievements
Rank 1
answered on 23 Sep 2010, 03:53 PM
I am getting the same behavior as the previous posts when I receive a jscript error on second 'postback'.
When I set the RadAjaxManager EnableAJAX="false", I do not get the error, but there is a full page postback, which is what I am trying to avoid with the AjaxManager.

Here are some snippets of code:

        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"/>
        <telerik:radformdecorator id="FormDecorator1" runat="server" DecoratedControls="all" Skin="Windows7"></telerik:radformdecorator>
         
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="false">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="GeoRadioList">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="GeoRadioList"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="GeoRadioListHelper"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadCboMyGeography"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadCboAllGeography"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="GeoRadioListHelper">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="GeoRadioList"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="GeoRadioListHelper"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadCboMyGeography"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadCboAllGeography"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadCboMyGeographyHelper">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadCboMyGeography"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadCboMyGeographyHelper"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                </AjaxSettings>
        </telerik:RadAjaxManager>
 
...
 
        <telerik:RadDockLayout runat="server" ID="RadDockLayout1">
        <table style="border-width: 0px; border-spacing: 0px;">
        <tr style="border-width: 0px; padding: 0px;">
        <td width="30%">
        <telerik:RadDockZone ID="RadDockZoneTopLeft" runat="server" Orientation="Vertical" BorderStyle="None">
        <telerik:RadDock ID="RadDockGeography" runat="server" Title="By Geography" Pinned="true" EnableAnimation="true" EnableRoundedCorners="true" Resizable="true" Width="300px" Height="140px">
        <Commands
            <telerik:DockExpandCollapseCommand /> 
        </Commands>
        <ContentTemplate>
         
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
            MultiPageID="chkMyGeography" Orientation="HorizontalTop" Font-Size="8pt" Align="Left"
            OnClientTabSelected="myGeoClick" AutoPostBack="false">
            <Tabs>
                <telerik:RadTab Text="My Geography" Height="25px" Width="100px" Font-Size="8pt" style="text-align:left;padding:0">
                </telerik:RadTab>
                <telerik:RadTab Text="All Geography" Height="25px" Width="100px" Font-Size="8pt" style="text-align:left;padding:0">
                </telerik:RadTab>
                <telerik:RadTab Text="Hotel" Height="25px" Width="100px" Font-Size="8pt" style="text-align:left;padding:0">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage runat="server" ID="chkMyGeography" SelectedIndex="0"
            title="Geography" Font-Size="8pt">
            <telerik:RadPageView runat="server" ID="MyGeoPage">
                <table style="font-size: 8pt">
                    <tr>
                        <td class="style1" width="300px">
                            <asp:RadioButtonList ID="GeoRadioList" runat="server" Font-Size="7pt"
                                RepeatDirection="Horizontal" style="font-size: 7pt" BorderStyle="None"
                                CellPadding="0" CellSpacing="0">
                                <asp:ListItem Value="SuperRegion" onclick="GeoRadioListClick();">Super Region</asp:ListItem>
                                <asp:ListItem Value="Region" onclick="GeoRadioListClick()">Region</asp:ListItem>
                                <asp:ListItem Value="MMTerritory" onclick="GeoRadioListClick()">Territory</asp:ListItem>
                                <asp:ListItem Value="Market" onclick="GeoRadioListClick()">Market</asp:ListItem>
                                <asp:ListItem Value="SubMarket" onclick="GeoRadioListClick()" Selected="True">Sub-Market</asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                    </tr>
                    <tr>
                    <td class="style1">
                    <telerik:RadComboBox ID="RadCboMyGeography"
                    runat="server"
                    AllowCustomText = "False"
                    OnClientDropDownClosing="OnClientDropDownClosing"
                    EnableViewState="true"                   
                    font-size="8pt"
                    Width="300px"
                    >
                        <ItemTemplate>
                            <div onclick="StopPropagation(event)">
                                <asp:CheckBox ID="CheckBox1" runat="server" Checked="True" AutoPostBack="False" OnClick="checkboxClick(this);" Text = '<%# DataBinder.Eval(Container, "Text") %>' />
                            </div>
                        </ItemTemplate>
                    </telerik:RadComboBox>
             
                        </td>
                    </tr>
                </table>   
            </telerik:RadPageView>
 
...
 
<%-- Below fields are hidden, but needed, for now --%>
        <div>
            <asp:Button ID="chkMyGeographyHelper" runat="server" Text="" OnClick="chkMyGeographyHelper_Click" class="hiddenClass" />
            <asp:Button ID="RadCboMyGeographyHelper" runat="server" Text="" OnClick="RadCboMyGeographyHelper_Click" class="hiddenClass" />
        </div>
 
...
 
        <script type="text/javascript">
 
 
            function OnClientDropDownClosing(sender) {
                var text = sender.get_id();
                var words = text.split("_");
                var len = (words.length) - 1;
                var lastword = words[len];
                //sender.get_id()
                alert(text + " called");
                document.getElementById(lastword + "Helper").click();
            }
 
    function StopPropagation(e) {
                //cancel bubbling
                e.cancelBubble = true;
                 if (e.stopPropagation) {
                    e.stopPropagation();
                }
            }
 
</script>
 
...

Any suggestions would be greatly appreciated. I'm kind of under the gun.

Thank you!
-Megan






0
Megan Vee
Top achievements
Rank 1
answered on 24 Sep 2010, 08:44 AM
So, I stripped away everything on the aspx page except for a radajaxmanager, radradiolist and a radcombobox.
The user selects a level from the radiolist and it updates the combobox dataset.
There should be no page reload as I am using the radajaxmanager.
The combobox has multiselect checkboxes.
The user should select the checkboxes they want and close the combo and the dropdown text should update to '3 selected', or whatever.
There should be no page reload as I am using the radajaxmanager.

All of this works! :)

Now, the whole point of the page is to run a report in the reportviewer.
When I add the report viewer to the page and click the radiolist twice or the combobox dropdown twice:
Poof - I get the jscript error:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Specified argument was out of the range of valid values.

Any ideas on how I can fix this?
I can attach the project, but it will take me a little while to create an offline dataset.
If any body is willing to help, I am willing to get a working offline project for testing.

Thanks in advance, 
Megan
0
Megan Vee
Top achievements
Rank 1
answered on 27 Sep 2010, 08:19 AM
FYI -
I removed the RadDockLayout, RadDockZones, and RadDocks and now everything works as planned.
It doesn't look as cool, but it works.
-Megan
0
Sampath
Top achievements
Rank 1
answered on 01 Feb 2016, 10:55 AM
When I replaced the radscriptmanager with a asp scriptmanager the issue was sorted in my case
0
Pavlina
Telerik team
answered on 03 Feb 2016, 12:09 PM
Hello Megan,

The error you are facing is rather generic and could not be easily isolated without having the runnable version of your application to debug. This blog post describes how you can isolate the problem in a sample project using dummy data: http://www.telerik.com/blogs/isolating-a-problem-in-a-sample-project. You could also disable the Ajax on the page and verify if the issue still persists.

Additionally, you can try to detect the erroneous script by disabling the script compression (set OutputCompression=false) and script combining (EnableScriptCombine=false) of RadScriptManager control. Now the HTTP traffic to the problematic page should be much more intensive and descriptive.

Another approach would be to replace the RadScriptManager with a standard ScriptManager as suggested by Sampath as the MS ScriptManager does not combine or compress the files it serves.

Regards,

Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Ajax
Asked by
Billy
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Billy
Top achievements
Rank 1
Avinash Kumar
Top achievements
Rank 1
Megan Vee
Top achievements
Rank 1
Sampath
Top achievements
Rank 1
Share this question
or