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

RadButton JavaScript Error in Azure

3 Answers 76 Views
Button
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 22 May 2013, 05:24 PM
Hello,

When I run the following locally, it executes without error. As soon as I upload it to Azure I get the following  javascript error:


SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a81e8380f-3d65-467a-87ae-ccddde9a2478%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%3aen-US%3abcbc5876-5d5e-4774-955e-2ecda3d55cd3%3a16e4e7cd%3af7645509%3a22a6274a%3aed16cbdc%3a86526ba7%3a874f8ea2%3a24ee1bba%3a7165f74, line 15 character 16238

The button is defined as follows:

<telerik:RadButton ID="loginButton" runat="server" Text="Login" SingleClickText="Validating" SingleClick="true" OnClick="btnLoginClick" >
               </telerik:RadButton>


The code behind is a follows: 

protected void btnLoginClick(object sender, EventArgs args)
   {
       try
       {
           string uName;
           string uPass;
           uName=UsernameBox.Text;
           uPass=PasswordBox.Text;
           if(uName=="admin" && uPass=="password")
           {
               Response.Redirect("dsxHome.aspx");
           }
           else
           {
               loginMessage.InnerText="Login Invalid!";
           }//end if
    
       }
       catch
       {
           loginMessage.InnerText="Problem with Login";
       }
    }//end function

Thoughts?


3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 24 May 2013, 07:53 AM
Hi Michael,

I am not quite sure what is the cause for your issue, so I can suggest you try to following:
  • Can you check whether scripts and web resources of the controls are loaded correctly? More information on RadControls integration with azure can be found in this help topic.
  • Another reason for the unexpected behavior might be if the path to the web resource is not correct. You can use Fiddler or FireBug to see which requests are failing and why. You can find useful this help article on this regard.
  • Also can you check whether you have enabled RadCompression for the application and if so, does disabling it resolve the issue?
  • Another option is try using the Telerik CDN to reference the resource from the cloud instead of locally.
  • Is the problem intermittent or is reproduced regularly? If you disable the script combining on the RadScriptManager does this stops the problem for reproducing? You can stop the script combining using the EnableScriptsCombine property.
  • Can you try to replace the RadButton with ASP button or RadButton (ButtonType="LinkButton") and what is the result?
  • Do you experience similar issues when deploying a project that utilizes the AjaxControlToolKit to Windows Azure? It is possible that there is some general difficulty with AJAX and Azure or that some of your exact settings are causing this. In that case you can make some searches in google on the topic.
We look forward receiving you answer.

Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Michael
Top achievements
Rank 1
answered on 14 Jun 2013, 03:55 PM
None of this has worked...there seems to be a problem Telerik and Azure....
0
Danail Vasilev
Telerik team
answered on 17 Jun 2013, 02:05 PM
Hi Michael,

Could please, try to replace RadControls with ASP controls, where possible, otherwise remove them, and then tell us whether the issue is still on board? If the unexpected behavior still occurs, this means the issue is not related to RadControls and its cause must be searched somewhere else.

Otherwise I can suggest you to send us a fully runnable sample with reproduction steps of the issue, so that we can make an investigation locally. Can you also check whether scripts and web resources of the controls are loaded correctly? If they are not loaded correctly which are the problematic requests?

For the time being, I can suggest you try the following:

It may be possible that a control is registered as an AsyncPostbackTrigger in multiple update panels. If that is so you can try adding the following right after the script manager declaration:
<script type="text/javascript" language="javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args){
        if (args.get_error() != undefined){
            args.set_errorHandled(true);
        }
    }
</script>

or you can set ValidateRequest="false" in the <%@ Page /> directive. In that case, however, you must ensure the usage of HttpUtility.HtmlEncode, in order to avoid XSS issues.

I can also suggest you to briefly examine this, this, this and this forum threads that treats the same issue.


Regards,
Danail Vasilev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Button
Asked by
Michael
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Michael
Top achievements
Rank 1
Share this question
or