Updatepanel with window.open

Last post 08-28-2007 8:18 PM by rbadis. 3 replies.

Sort Posts:

  • Updatepanel with window.open

    08-28-2007, 2:46 AM
    • Member
      10 point Member
    • rbadis
    • Member since 04-23-2007, 3:44 AM
    • Posts 339

    Hi,

    The below code is from a button and it is working fine outside an updatepanel but it doesn't do anything if I put the button inside the updatepanel...! what could be the problem?  

     

    if (!this.Page.ClientScript.IsStartupScriptRegistered(this.GetType(), "GetEvaluation"))

    {

    StringBuilder sb = new StringBuilder();

    sb.Append("<script>");

    sb.Append("window.open('../AssessmentFrm.aspx','new','left=50, top=10, height=650, width= 950, status=yes, resizable= no, scrollbars= yes, toolbar= no,location= no, menubar= no')");

    sb.Append("</script>");

    this.Page.ClientScript.RegisterStartupScript(this.GetType(), "GetEvaluation", sb.ToString());

    }

     

    Thanks.

    badis
  • Re: Updatepanel with window.open

    08-28-2007, 5:38 AM
    • Participant
      1,339 point Participant
    • Mahadeomatre
    • Member since 04-23-2007, 11:00 AM
    • Pune, India
    • Posts 230

    write a postback trigger for ur button which is in the Updatepanel.

    the postback trigger is written on Updatepanel. the syntex for postback trigger is like

    <asp:UpdatePanel id="UpdatePanel1" runat="server">

          <triggers>

                  <asp:PostBackTrigger ControlID="Button1"></asp:PostBackTrigger>

            </triggers>

    </asp:UpdatePanel>

     

    Thanks,
    Mahadeo

    -----------------------------------------------
    Best is Not the END point, but a starting point for Innovation
    ------------------------------------------------
    Remember to mark posts as the "Answer" to help future users.
  • Re: Updatepanel with window.open

    08-28-2007, 2:26 PM
    Answer
    • Star
      13,605 point Star
    • gt1329a
    • Member since 06-24-2002, 12:53 AM
    • Atlanta
    • Posts 2,248
    • ASPInsiders
      TrustedFriends-MVPs

    Use ScriptManager.RegisterStartupScript() instead of ClientScript's method. 

    Encosia - ASP.NET, jQuery, AJAX, and more.

    Latest article: Emulate ASP.NET validation groups with jQuery validation
  • Re: Updatepanel with window.open

    08-28-2007, 8:18 PM
    • Member
      10 point Member
    • rbadis
    • Member since 04-23-2007, 3:44 AM
    • Posts 339

    do you know how I googled around but I could fine an efficient solution?

     

    Thanks

    badis
Page 1 of 1 (4 items)