Page.RegisterStartupScript doesn't work in IE7
-
Hi I have a botton on my page, which should write something in sessions and then open a new page. There isn't any target in the link button, so I choosed to make a Page.Register to open a new window. My Code is:
protected void btnPrintKoerselDate_Click(object sender, EventArgs e) { Session["KoerselStart"] = txtFromDate.Text; Session["KoerselSlut"] = txtToDate.Text; Session["Koersel"] = "Date"; string popupScript = "" + "window.open('PrintKoersel.aspx', 'Print kørsel', " + "'width=1000, height=1000, menubar=yes, resizable=yes')" + ""; Page.RegisterStartupScript("PrintJS", popupScript); }
When I run the code in Firefox it works ok, but when I run the code in IE7 I get the following error (and the new page don't appear like in Firefox). I have disabled popupkiller in IE7 and turned of my firewall, so there isn't any kind of popup killer. Line: 278 Char: 1 Error: Invalid argument Code: 0 URL: http://localhost:1739/ANSI/Faktura/Lister.aspx Can anyone help me please, to get the above to function in IE or to give me alternative to have a button which write something in sessions and then open a new page? Kind regards, simsen :-) -
Hi I have a botton on my page, which should write something in sessions and then open a new page. There isn't any target in the link button, so I choosed to make a Page.Register to open a new window. My Code is:
protected void btnPrintKoerselDate_Click(object sender, EventArgs e) { Session["KoerselStart"] = txtFromDate.Text; Session["KoerselSlut"] = txtToDate.Text; Session["Koersel"] = "Date"; string popupScript = "" + "window.open('PrintKoersel.aspx', 'Print kørsel', " + "'width=1000, height=1000, menubar=yes, resizable=yes')" + ""; Page.RegisterStartupScript("PrintJS", popupScript); }
When I run the code in Firefox it works ok, but when I run the code in IE7 I get the following error (and the new page don't appear like in Firefox). I have disabled popupkiller in IE7 and turned of my firewall, so there isn't any kind of popup killer. Line: 278 Char: 1 Error: Invalid argument Code: 0 URL: http://localhost:1739/ANSI/Faktura/Lister.aspx Can anyone help me please, to get the above to function in IE or to give me alternative to have a button which write something in sessions and then open a new page? Kind regards, simsen :-)