Rad Ajax Panel errors on postback when in IE 6

7 posts, 0 answers
  1. Mick
    Mick avatar
    40 posts
    Member since:
    Oct 2006

    Posted 25 Oct 2010 Link to this post

    Hi,

    We have a user control that has a rad ajax panel on there to "ajaxify" the page.  Upon clicking the Submit button we fire off an ajax request to the server and then add some javascript to our panels response scripts.

    This is working in all browsers except... yes you guessed it... IE6!

    In IE 6 all of the server side code is executed but the client script that was added to the response scripts is not fired.  We then get the following error message:

    "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."
    This is thrown at the following location:

    _endPostBack: function PageRequestManager$_endPostBack(error, executor, data) {
            if (this._request === executor.get_webRequest()) {
                this._processingRequest = false;
                this._additionalInput = null;
                this._request = null;
            }
     
            var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
            Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
            if (error && !eventArgs.get_errorHandled()) {
                throw error;
            }
        },

    I have no idea where to go from this point so any help is greatly appreciated.  I have also included the
    code below to help diagnose what the issue could be.

    <telerik:RadAjaxPanel ID="rap" runat="server" Width="100%" OnAjaxRequest="rap_AjaxRequest"
        LoadingPanelID="ralp">
        <div id="enquiryWrapper">
            <div id="detailsDiv">
                <h2>
                    Your Details</h2>
                <h3>
                    Name:</h3>
                <p>
                    <asp:TextBox ID="NameBx" runat="server"></asp:TextBox></p>
                <h3>
                    Telephone:</h3>
                <p>
                    <asp:TextBox ID="TelBx" runat="server"></asp:TextBox></p>
                <h3>
                    Email:</h3>
                <p>
                    <asp:TextBox ID="EmailBx" runat="server"></asp:TextBox>
                    <asp:HiddenField ID="hidSubject" runat="server" ClientIDMode="Static" />
                </p>
            </div>
            <div id="requestDiv">
                <h2>
                    Nature of your enquiry</h2>
                <textarea id="EnqTxtBx" cols="40" rows="10"></textarea>
            </div>
            <div id="submitDiv">
                <h2>
                    Submit your request</h2>
                <img id="sendBtn" alt="SendButton" src="themes/buttons/SendBtn.png" class="clickable"
                    title="Submit your Enquiry" onclick="SendEnquiry()" onmouseover="javascript:this.src='themes/buttons/sendBtn-on.png'"
                    onmouseout="javascript:this.src='./themes/buttons/sendBtn.png'" />
                <img id="cancelBtn" alt="CancelButton" src="themes/buttons/CancelBtn.png" class="clickable"
                    title="Cancel" onclick="SlideOut(0,'top','OUT')" onmouseover="javascript:this.src='themes/buttons/cancelBtn-on.png'"
                    onmouseout="javascript:this.src='themes/buttons/cancelBtn.png'" />
                <div id="EnqMessageDiv" runat="server" style="display: none;">
                    <img src="./themes/cross.png" alt="Invalid: " runat="server" id="MessageImg" style="width: 16px;
                        height: 16px;" />
                    <asp:Label runat="server" ID="MessageLbl"></asp:Label>
                </div>
            </div>
        </div>
    </telerik:RadAjaxPanel>
    <telerik:RadScriptBlock ID="rsb" runat="server">
        <script type="text/javascript">
            function SendEnquiry()
            {
                var oAjax = <%= rap.ClientID %>;
                var txtBx = document.getElementById("EnqTxtBx");
                var EnqTxt = txtBx.value;
                oAjax.ajaxRequest("Enq|"+EnqTxt+"|");
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxLoadingPanel ID="ralp" Runat="server" Skin="Default" Transparency="50">
    </telerik:RadAjaxLoadingPanel>

    protected void rap_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
            {
                string[] Args = e.Argument.Split('|');
     
                if (Args[0] == "Enq")
                {
                    ..... Process data .....
     
                    if (dnCustom.strFuncs.isValidEmail(EmailBx.Text))
                    {
                        if (!PromatMail.SendMail())
                        {
                            BlankFields();
                            rap.ResponseScripts.Add("alert('Sorry! We are experiencing errors in our mail server at this time. Please try again later'); SlideOut(0,'top','OUT');");
                        }
                        else
                        {
                            BlankFields();
                            if (!CustMail.SendMail())
                            {
                                rap.ResponseScripts.Add("alert('Thankyou for your enquiry we will get back to as soon as possible'); SlideOut(0,'top','OUT');");
                            }
                            else
                            {
                                rap.ResponseScripts.Add("alert('Thankyou for your enquiry we will get back to as soon as possible'); SlideOut(0,'top','OUT');");
                            }
                        }
                    }
                    else
                    {
                        rap.ResponseScripts.Add("alert('The Email address you supplied is invalid. please amend it and try again.');");
                    }
                }
            }


    Thanks in advance,

    M
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Oct 2010 Link to this post

    Hello Mick Gibbin,

    I revise the provided code and it looks ok to me. Could you please let me know what is the application behavior if no Ajax is used and also if regular UpdatePanel is used instead of RadAjax?


    Sincerely yours,
    Maria Ilieva
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Mick
    Mick avatar
    40 posts
    Member since:
    Oct 2006

    Posted 15 Nov 2010 Link to this post

    Apologies for the delayed response, we removed the AJAX functionality on the above piece of code to get around the issue.  Ajax was being used when they clicked on the submit button I only wanted to do a partial postback as we wanted to process the enquiry, show a popup message and then perform some jquery.  I can also confirm we were using the rad ajax panel and not the update panels.

    I have come across the exact same issue in another area of the site now which I would really appreciate you helping us out on.  The code is :

    <telerik:RadScriptBlock ID="rsb" runat="server">
        <script type="text/javascript">
            var currentOption = "";
             
            function showImage(image) {
                var oAjax = <%= rapImg.ClientID %>;
                oAjax.ajaxRequest(image);
            }
     
        </script>
    </telerik:RadScriptBlock>
     
    <div id="nonstdimage">
    <telerik:RadAjaxPanel ID="rapImg" runat="server"
        OnAjaxRequest="rapImg_AjaxRequest" LoadingPanelID="ralp">
        <a class="screenshot">
            <asp:Image ID="imgNonStdParade" runat="server" CssClass="bureauximage"
               AlternateText="Non Standard Parade Example Image"
               ImageUrl="./themes/nonStdParades/bureaux_remBlemish.jpg" />
        </a>
        <img id="imgFull" alt="Loading" src="./themes/bureaux_remBlemishbig.png" />
    </telerik:RadAjaxPanel>
    <telerik:RadAjaxLoadingPanel ID="ralp" runat="server" Skin="WebBlue"
        Transparency="50" />
    </div>

    The javascript that fires will then fire an ajax request to the server and this will execute the following code:

    protected void rapImg_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        // This has been called due to us wanting to change the image to the one
        //   specified in the argument
        imgNonStdParade.ImageUrl = String.Format("./themes/bureaux_{0}.jpg",e.Argument);
    }

    This means that when the list items are clicked, we can perform an ajax request to change the current image on the screen without having to do a full page postback.

    HOWEVER, in IE6, we are getting the same error...
        "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed."

    HELP..... :-(
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 15 Nov 2010 Link to this post

    Hello Mick,

    As I previously asked could you please test the same scenario but using asp UpdatePanel instead of RadAjaxPanel? This will help us isolate the issue and verify if its root cause.


    Regards,
    Maria Ilieva
    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
  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 15 Nov 2010 Link to this post

    Hello Mick,

    As I previously asked could you please test the same scenario but using asp UpdatePanel instead of RadAjaxPanel? This will help us isolate the issue and verify if its root cause.


    Regards,
    Maria Ilieva
    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
  7. Mick
    Mick avatar
    40 posts
    Member since:
    Oct 2006

    Posted 16 Nov 2010 Link to this post

    Hi,

    I have tried replacing the telerik code with an update panel and generating a client side postback to the server and we are still seeing the same issues.  If you could give me any indications as to what may be going wrong it would be greatly appreciated.  We also simply removed the ajax postback and this in turn meant clicking the links did not do anything and it therefore did not error.

    Thanks,

    M
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 19 Nov 2010 Link to this post

    Hello Mick Gibbin,

    As the error appear even removing all RadAjax components this means that it could be caused by something in your application logic or is some specific browser behavior which is not directly relates to telerik controls.
    Try to debug the application without using telerik control and see where the error is fired.


    Regards,
    Maria Ilieva
    the Telerik team

    Browse the vast support resources we have to jumpstart 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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017