Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page.RegisterStartupScript doesn't work in IE7

Page.RegisterStartupScript doesn't work in IE7

Scheduled Pinned Locked Moved ASP.NET
helpquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    simsen
    wrote on last edited by
    #1

    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 :-)

    S 1 Reply Last reply
    0
    • S 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 :-)

      S Offline
      S Offline
      simsen
      wrote on last edited by
      #2

      I found out by myself :-) The name must not have any spaces in the name, and the sizes must not have '' around simsen :-)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups