SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript window.open via button click event in code behind

    Hello!

    We're on ASP.NET 1.1.
    I'm trying to open a new window on a click event.

    If I use the attributes.add in the Page_Load, then pop-up window gets hit before an update occurs...hence, the pop-up window is just a little too early.

    I'm trying this in my button click event, but it's not bringing up the new window:

    Response.Write("<script language=""javascript"">window.open('UpdateBudgetConfirm.aspx?UBID=" + strSAID + "','','width=500,height=320,left=200,top=200');"")</script>")

    Thanks!

  2. #2
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trying this but no luck

    Hello!

    I'm using VB, but this is not liking the Page.ClientScript part...saying 'Client Script' is not a member of 'system.UI.web.page':

    Page.ClientScript.RegisterStartupScript(Me.GetType(), "Window", "window.open('UpdateBudgetConfirm.aspx?UBID=" + strSAID + "','','width=500,height=320,left=200,top=200');", True)

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still no luck:

    Page.RegisterStartupScript("Window", "<script language=""javascript"">window.open('UpdateBudgetConfirm.aspx?UBID=" + strSAID + "','','width=500,height=320,left=200,top=200');"")</script>")

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I try the followng in Page_Load, but get a syntax error:

    Page.RegisterStartupScript("Window", "<script language=javascript>function AlertUpdate() {window.open('UpdateBudgetConfirm.aspx?UBID=" + strSAID + "','','width=500,height=320,left=200,top=200');})</script>")

    btnYes.Attributes("onclick") = "AlertUpdate()"


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •