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 problem

javascript problem

Scheduled Pinned Locked Moved ASP.NET
javascripthelpquestion
6 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.
  • K Offline
    K Offline
    krishnaveer
    wrote on last edited by
    #1

    hi guys I am using master page and content page in my application i want to execute some code on load of content page code is below Type type = GetType(); const string scriptName = "alertPopup"; if (!ClientScript.IsStartupScriptRegistered(type, scriptName)) { ClientScript.RegisterStartupScript(type, scriptName, "javascript:window.history.forward(-1);", true); } this code is running properly but when i am using ajax tool kit then this code is not working what is the problem any one give me solution plz

    krishna veer singh

    C A 2 Replies Last reply
    0
    • K krishnaveer

      hi guys I am using master page and content page in my application i want to execute some code on load of content page code is below Type type = GetType(); const string scriptName = "alertPopup"; if (!ClientScript.IsStartupScriptRegistered(type, scriptName)) { ClientScript.RegisterStartupScript(type, scriptName, "javascript:window.history.forward(-1);", true); } this code is running properly but when i am using ajax tool kit then this code is not working what is the problem any one give me solution plz

      krishna veer singh

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Doing this sort of history stuff is almost always a nightmare. What are you doing it for ? You know people can turn it off, right ? Have you run the code in firefox with firebug and set breakpoints to see if your code is called, and if it's even there ?

      Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

      K A 2 Replies Last reply
      0
      • C Christian Graus

        Doing this sort of history stuff is almost always a nightmare. What are you doing it for ? You know people can turn it off, right ? Have you run the code in firefox with firebug and set breakpoints to see if your code is called, and if it's even there ?

        Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

        K Offline
        K Offline
        krishnaveer
        wrote on last edited by
        #3

        then what will be alternative solution for that plz suggest me

        krishna veer singh

        C 1 Reply Last reply
        0
        • K krishnaveer

          hi guys I am using master page and content page in my application i want to execute some code on load of content page code is below Type type = GetType(); const string scriptName = "alertPopup"; if (!ClientScript.IsStartupScriptRegistered(type, scriptName)) { ClientScript.RegisterStartupScript(type, scriptName, "javascript:window.history.forward(-1);", true); } this code is running properly but when i am using ajax tool kit then this code is not working what is the problem any one give me solution plz

          krishna veer singh

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          krishnaveer wrote:

          i am using ajax tool kit then this code is not working

          your are using Ajax , so you have to use ScriptManager insted of ClientScript.

          krishnaveer wrote:

          if (!ClientScript.IsStartupScriptRegistered(type, scriptName)) { ClientScript.RegisterStartupScript(type, scriptName, "javascript:window.history.forward(-1);", true); }

          use ScriptManager insted of ClientScript and RegisterStartupScriptBlock It will Work !!!

          cheers, Abhijit Check My Latest Article

          1 Reply Last reply
          0
          • K krishnaveer

            then what will be alternative solution for that plz suggest me

            krishna veer singh

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            There is absolutely no failsafe way to render a page and force it to go to the prior page, if you do it on the client side. You need to redirect on the server.

            Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

            1 Reply Last reply
            0
            • C Christian Graus

              Doing this sort of history stuff is almost always a nightmare. What are you doing it for ? You know people can turn it off, right ? Have you run the code in firefox with firebug and set breakpoints to see if your code is called, and if it's even there ?

              Christian Graus No longer a Microsoft MVP, but still happy to answer your questions.

              A Offline
              A Offline
              astanton1978
              wrote on last edited by
              #6

              DebugBar for IE may be helpful if you cant get FireBug/FF to work.

              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