"Error on this webpage might cause it to work incorrectly" script into UpdatePanel

Last post 07-04-2009 4:53 AM by Alessio Lombardi. 3 replies.

Sort Posts:

  • "Error on this webpage might cause it to work incorrectly" script into UpdatePanel

    07-03-2009, 2:07 PM

    Hi everybody!

    in my page i've only an updatePanel and i use js alert to display a messageBox in cause of error;

    Sometimes when i run the application; IE back me the error in the subject.

     

    Expected ')'

    Code:0

    In the specific the error details is:

     

    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729)
    Timestamp: Fri, 3 Jul 2009 17:47:44 UTC


    Message: Expected ')'
    Line: 86604737
    Char: 20
    Code: 0
    URI: *****

    The code i use to display js alert for all the messageBox is :

    String script = "alert('Error!.');";        //The message depends by the error i want to display     
    ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), Page.ClientID, script, true);

     

     

     

  • Re: "Error on this webpage might cause it to work incorrectly" script into UpdatePanel

    07-04-2009, 1:41 AM
    Answer

    You mention that the message depends on the error, and that the problem is intermittent, so isn't it possible the error text might be causing this?

    Another thing I notice is that you're using the ScriptManager.RegisterClientScriptBlock overload that registers the script block each time an asynchronous postback occurs. Is this what you want? You probably already know this, but do check out the Remarks section on this page, http://msdn.microsoft.com/en-us/library/bb338357.aspx

    Thanks

    Carsten

    Please click Mark as Answer if this post is of help to you. :-)



    My Blog
  • Re: "Error on this webpage might cause it to work incorrectly" script into UpdatePanel

    07-04-2009, 4:29 AM

     i've a little knowledge in script manager and ajax in generally;  i read on the guides to use that code to display a messageBox when the code is into an UPanel and i'm using that for all the scripts.

    So in all my application all the scripts are ok, but two of them show me the error i've mentioned above. i need only the scripts show correctly the messageBox but although i'm using the same code for all the scripts, two of them inexplicably doesn't work correctly!

    :-D

  • Re: "Error on this webpage might cause it to work incorrectly" script into UpdatePanel

    07-04-2009, 4:53 AM

    I'm Sorry but, i've resolved the problem simply deleting the ' in the text of the script; the apostrophe is the error. i find out it by chance while i'm changing the message... :-D 

Page 1 of 1 (4 items)