1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Need to close parent window when pop up opens

Discussion in 'C#' started by nithin.gujjar, Sep 15, 2008.

  1. #1
    I need to close the parent window which opens a pop up.I have tried the following:


    Response.Write("<script>");
    Response.Write("window.open('http://URL_IPadd:8000/Pages/ValidateUser.aspx?JVId=PW0000001&SessionId=1000&IsAdmin=Y&RoleName=Self','PORTFOLIOTRACKER',' scroll=true,resizable=yes,toolbar=no,location=no,directories=no,dependent=no,fullscreen=no,status=yes,left=0,top=0,height='+screen.height-60+',width='+screen.width-5);");
    Response.Write("window.opener.close();");
    Response.Write("</script>")
     
    nithin.gujjar, Sep 15, 2008 IP
  2. SearchBliss

    SearchBliss Well-Known Member

    Messages:
    1,899
    Likes Received:
    70
    Best Answers:
    2
    Trophy Points:
    195
    Digital Goods:
    1
    #2
    First off, the format:
    Response.Write("<script>");
    Is incorrect.
    It's:

    Response.Write "<script>"

    Second, repeating Response.Write is redundant. Try:

    Response.Write "<script>" & vbNewline & _
    window.open('http... & vbNewline & _

    Third, it appears that you are writing javascript, and if your original vbscript was to work, it would be writing javascript that wouldn't work.
     
    SearchBliss, Sep 15, 2008 IP