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. Javascript - Alert and Redirect???

Javascript - Alert and Redirect???

Scheduled Pinned Locked Moved ASP.NET
javascriptquestion
4 Posts 3 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.
  • G Offline
    G Offline
    gyokusei
    wrote on last edited by
    #1

    When I finished page 1, I want to show a messagebox to alert about something. After that, I will redirect to page 2 but these codes doesn't work: string s = "alert('Alert something'); location.href='page2.aspx';"; Page.RegisterClientScriptBlock("alarm",s ) The messagebox doesn't appear. It jz redirect to page2.aspx ??? Who can tell me why?

    P I 2 Replies Last reply
    0
    • G gyokusei

      When I finished page 1, I want to show a messagebox to alert about something. After that, I will redirect to page 2 but these codes doesn't work: string s = "alert('Alert something'); location.href='page2.aspx';"; Page.RegisterClientScriptBlock("alarm",s ) The messagebox doesn't appear. It jz redirect to page2.aspx ??? Who can tell me why?

      P Offline
      P Offline
      Prasad Babu A
      wrote on last edited by
      #2

      Hi, I tried with ur code, its working fine. Try in new applicaiton. Bye Pessi.

      G 1 Reply Last reply
      0
      • G gyokusei

        When I finished page 1, I want to show a messagebox to alert about something. After that, I will redirect to page 2 but these codes doesn't work: string s = "alert('Alert something'); location.href='page2.aspx';"; Page.RegisterClientScriptBlock("alarm",s ) The messagebox doesn't appear. It jz redirect to page2.aspx ??? Who can tell me why?

        I Offline
        I Offline
        Ista
        wrote on last edited by
        #3

        to Page.RegisterStartUpScript 1 line of code equals many bugs. So don't write any!!

        1 Reply Last reply
        0
        • P Prasad Babu A

          Hi, I tried with ur code, its working fine. Try in new applicaiton. Bye Pessi.

          G Offline
          G Offline
          gyokusei
          wrote on last edited by
          #4

          try this: Tools -> Internet Options -> Advanced -> Uncheck Disable Script Debugging. and restart your web application. The script error will occur. ("contentWindow.document" is null or not an object) the same with Page.RegisterStartUpScript() ????

          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