| Article: |
Enhancing ASP.NET Pages with JavaScript | |
| Subject: | Problem with Page.RegisterStartupScript | |
| Date: | 2005-03-23 22:45:28 | |
| From: | vishalvishal | |
|
Hi,
|
||
Showing messages 1 through 3 of 3.
-
Problem with Page.RegisterStartupScript
2006-06-27 04:35:50 ROCK007 [View]
-
Problem with Page.RegisterStartupScript
2005-05-20 03:11:21 u [View]
set a flag for back and in main page check the flage if true? no action should be done.like this one
if(!Back)
page.RegisterStartupScript("name",name) -
Problem with Page.RegisterStartupScript
2007-01-29 11:43:13 Manindra [View]
Try this,
Page.ClientScript.RegisterStartupScript(GetType(string), "name", name)
I hope it will work...



Another same alike query. When we add a Page.RegisterStartupScript and try to browse to another page from the current page (where this javascript is written), we get a message saying "Do you really want to navigate from the current page?" since we have used window.BeforeUnload to halt when some values are changed. Even though we have clicked "Cancel" button to avoid going out of the page, it stays back but after clicking the "save" button it does not fires the "Button_Click" event handler. This Button click handler works with the normal case.
What should be done to drap the Button_Click event in such case?
ThanX