RadWindow e is undefined error after RegisterStartupScript

1 posts, 0 answers
  1. mc2000
    mc2000 avatar
    48 posts
    Member since:
    Nov 2009

    Posted 08 Nov 2010 Link to this post

    I also opened a case on this but feel others might either (a) have insights or (b) get value out of the response. Thanks!
    *************
    I have a radwindow:
    <telerik:RadWindow ID="StudentCheckListWindow" runat="server" Modal="True" AutoSize="true" EnableShadow="true"
      
    Behaviors="Close" ReloadOnShow="true">

    With a user control inside. The user control has a radgrid which lists a series of links. When one of the links is clicked it does a response.redirect to redirect the page.

    During testing, I enabled IE script debugging and I am getting the attached error (saying e is undefined). I have tracked it down to the following scenario.

    1. Page opens with RadWindow hidden
    2. User clicks on a link which calls some JavaScript using RegsiterStartupScript (see below)
    3. User then opens the RadWindow via oWnd.Show() syntax and RadWindow opens
    4. Item is clicked and response.redirect is called. JavaScript error (attached) is thrown. Page DOES redirect fine.

    If the item is clicked in the RadWindow before any RegisterStartupScript is called everything is fine. Also, if I run something RegisterStartupScript and then do a full page postback and then open the window everything is fine. It's almost like RegisterStartupScript is changing the page DOM and then the RadWindow is throwing an error which is fixed by a full postback.

    My code block looks something like:

    ScriptManager.RegisterStartupScript(Page, this.GetType(), "RedirectScript", "window.open('" + redirect + "');", true);

    Thanks in advance!
Back to Top