a question regarding .NET postbacks and javascript

Discussion in 'ASP .Net' started by pj121, Dec 31, 2004.

  1. pj121

    pj121 Guest

    Hi,

    Here's my situation:

    I have an asp.net webform and it has a linkbutton on it. The
    linkbutton causes a postback. So the user selects some values and then
    clicks the linkbutton. Now, based on the values the user selected, a
    pop up window will get displayed when they click the linkbutton.

    So in the event handler for the linkbutton postback I do the following.

    //Get the users selected values and show the appropriate popup
    private void lnkPopup_Click(object sender, System.EventArgs e)
    {
    Response.Write("<SCRIPT language='javascript'> " +
    "window.open(url,'previewWnd',"
    + "'Height=450;Width=600;toolbar=no;menubar=no;scrollbars=yes;status=no;resizable=yes;');"
    + " </SCRIPT>");
    }

    So all it does is in the event is figure out the url variable based on
    user selections and then show the popup using Response.Write

    This works great in IE, but it does not work in Netscape 7 or Mozzilla
    - it wwill not show the popup window in these browsers.
    Any ideas why?

    TIA
     
    pj121, Dec 31, 2004
    #1
    1. Advertisements

  2. pj121

    Karl Seguin Guest

    Works fine. If you type javascript: into the address box, do you see any
    errors?

    Where is the javascript variable "url" being set? why is this a client-side
    variable as opposed to a server side? My guess is that there's some
    confusion here on your part...

    Karl
     
    Karl Seguin, Dec 31, 2004
    #2
    1. Advertisements

  3. pj121

    pj121 Guest

    I need to make a pop up window when the postback event get finished.
    This code works in ie but now in Netscape or Mozzilla

    Do you know of another way to make a pop up window after the vent
    handler gets processed?

    Thanks
     
    pj121, Dec 31, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.