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. Java Script issue

Java Script issue

Scheduled Pinned Locked Moved ASP.NET
helpjavatoolstutorial
9 Posts 4 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi all, I am registering one student so its corrosponding id is getting generated. i want to display this id in message box and redirect to another page , but i am not able to display alert box or message box because before displaying message i am redirecting to another page. how to solve this problem. Thanks, Amit Patel

    S B 2 Replies Last reply
    0
    • L Lost User

      Hi all, I am registering one student so its corrosponding id is getting generated. i want to display this id in message box and redirect to another page , but i am not able to display alert box or message box because before displaying message i am redirecting to another page. how to solve this problem. Thanks, Amit Patel

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

      Are you using alert and location.window.href in the same javascript function? If yes it should work, because as far as I know is alert blocking... Could you post a bit of the code, for a better understanding? Regards Sebastian

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      L E 2 Replies Last reply
      0
      • S SeMartens

        Are you using alert and location.window.href in the same javascript function? If yes it should work, because as far as I know is alert blocking... Could you post a bit of the code, for a better understanding? Regards Sebastian

        It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Hi, < string script = "<script language='javascript'>"; script += "alert('" + patientId + "');\n"; script += "</script>"; RegisterStartupScript("StartUp", script); Response.Redirect("NewAppointment.aspx");> Because of this Page is redirecting to another page and pop up is not coming Regards, Amit patel

        S 1 Reply Last reply
        0
        • L Lost User

          Hi, < string script = "<script language='javascript'>"; script += "alert('" + patientId + "');\n"; script += "</script>"; RegisterStartupScript("StartUp", script); Response.Redirect("NewAppointment.aspx");> Because of this Page is redirecting to another page and pop up is not coming Regards, Amit patel

          S Offline
          S Offline
          SeMartens
          wrote on last edited by
          #4

          In that case, you shouldn't use Response.Redirect on the server. Do the redirect within your script:

          ...
          script += "window.location.href='http://Myserver/Myclient/NewAppointment.aspx';";
          ...

          Regards Sebastian

          It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

          1 Reply Last reply
          0
          • L Lost User

            Hi all, I am registering one student so its corrosponding id is getting generated. i want to display this id in message box and redirect to another page , but i am not able to display alert box or message box because before displaying message i am redirecting to another page. how to solve this problem. Thanks, Amit Patel

            B Offline
            B Offline
            Blue_Boy
            wrote on last edited by
            #5

            Page.RegisterClientScriptBlock("redirect", "<script>alert('You will be redirected in anoher page!'); window.location='default2.aspx';</script>");


            I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

            L 1 Reply Last reply
            0
            • B Blue_Boy

              Page.RegisterClientScriptBlock("redirect", "<script>alert('You will be redirected in anoher page!'); window.location='default2.aspx';</script>");


              I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Hi , Thanks all Page.RegisterClientScriptBlock("redirect", "<script>alert('You will be redirected in anoher page!'); window.location='default2.aspx';</script>"); This code is working fine Thanks blue boy

              B 1 Reply Last reply
              0
              • L Lost User

                Hi , Thanks all Page.RegisterClientScriptBlock("redirect", "<script>alert('You will be redirected in anoher page!'); window.location='default2.aspx';</script>"); This code is working fine Thanks blue boy

                B Offline
                B Offline
                Blue_Boy
                wrote on last edited by
                #7

                You are welcome.


                I Love T-SQL www.aktualiteti.com "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                1 Reply Last reply
                0
                • S SeMartens

                  Are you using alert and location.window.href in the same javascript function? If yes it should work, because as far as I know is alert blocking... Could you post a bit of the code, for a better understanding? Regards Sebastian

                  It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

                  E Offline
                  E Offline
                  engg_sukreet
                  wrote on last edited by
                  #8

                  if you can do this with javascript then you can use alert box like this alert(pass the value of generated id value) and then redirect to next page.

                  S 1 Reply Last reply
                  0
                  • E engg_sukreet

                    if you can do this with javascript then you can use alert box like this alert(pass the value of generated id value) and then redirect to next page.

                    S Offline
                    S Offline
                    SeMartens
                    wrote on last edited by
                    #9

                    Lol, thanks again for repeating the answer. Saying something twice is better than once :)

                    It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

                    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