javascript problem
-
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
-
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
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.
-
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.
then what will be alternative solution for that plz suggest me
krishna veer singh
-
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
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 ofClientScript
.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
-
then what will be alternative solution for that plz suggest me
krishna veer singh
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.
-
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.
DebugBar for IE may be helpful if you cant get FireBug/FF to work.