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. alert .Ok click

alert .Ok click

Scheduled Pinned Locked Moved ASP.NET
question
6 Posts 2 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
    lehya
    wrote on last edited by
    #1

    there is an alert box that get displayed when necessary on webform1.aspx page..Now when i click on ok on alert window, the page should get redirected to webpage2.aspx... Is there any solution? something like... alert("alert message here",alert.OK, function ).....something like this..

    G 1 Reply Last reply
    0
    • L lehya

      there is an alert box that get displayed when necessary on webform1.aspx page..Now when i click on ok on alert window, the page should get redirected to webpage2.aspx... Is there any solution? something like... alert("alert message here",alert.OK, function ).....something like this..

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Just put the code to redirect the page after the code that displays the alert box. --- b { font-weight: normal; }

      L 1 Reply Last reply
      0
      • G Guffa

        Just put the code to redirect the page after the code that displays the alert box. --- b { font-weight: normal; }

        L Offline
        L Offline
        lehya
        wrote on last edited by
        #3

        STILL THE PAGE STAYS WHERE IT IS WHEN I INSERTED THE CODE ALERT..AND LATER SERVER.TRANSFER CODE IT DOESNT WORK FOR ME

        G 1 Reply Last reply
        0
        • L lehya

          STILL THE PAGE STAYS WHERE IT IS WHEN I INSERTED THE CODE ALERT..AND LATER SERVER.TRANSFER CODE IT DOESNT WORK FOR ME

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

          Stop SCREAMING! There is no Server.Transfer in Javascript. --- b { font-weight: normal; }

          L 1 Reply Last reply
          0
          • G Guffa

            Stop SCREAMING! There is no Server.Transfer in Javascript. --- b { font-weight: normal; }

            L Offline
            L Offline
            lehya
            wrote on last edited by
            #5

            ha ha...You got me wrong Guffa... Here comes my code... if(username == checkname) { string strmessage1 = "UserID" + " " + username + " " + "already Exists!!"; RegisterStartupScript("scripta","alert('" + strmessage1 + "');"); } Server.Transfer("test.aspx"); That was the code..After alert displays on page..I click OK..and page doesnt process anymore..I see the samepage without redirecting to test.aspx after alert display

            G 1 Reply Last reply
            0
            • L lehya

              ha ha...You got me wrong Guffa... Here comes my code... if(username == checkname) { string strmessage1 = "UserID" + " " + username + " " + "already Exists!!"; RegisterStartupScript("scripta","alert('" + strmessage1 + "');"); } Server.Transfer("test.aspx"); That was the code..After alert displays on page..I click OK..and page doesnt process anymore..I see the samepage without redirecting to test.aspx after alert display

              G Offline
              G Offline
              Guffa
              wrote on last edited by
              #6

              You are mixing up server side code with client side code. 1. The server side code is run on the server to create the page. 2. The page is sent to the browser. 3. The browser parses the page and runs the client side scripts in it. The Server.Transfer will be executed at the first step, and the alert will be executed at the third step. --- b { font-weight: normal; }

              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