Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi experts here
I show jquery popup from code behind using registerstartupscript method.but sometimes user need to refresh the page(by pressing browser refresh button or F5) and normally what happens is the popup shown again.how can i avoid this that popup will never be shown on page refresh when i need to show popup from code behind...
Posted
Updated 19-Dec-11 1:40am
v2
Comments
Smithers-Jones 19-Dec-11 7:40am    
Removed <pre>-tags

1 solution

Only add the RegisterStartupScript when the IsPostback == false;
 
Share this answer
 
Comments
mridul samadder 19-Dec-11 9:06am    
thats not possible coz i have to register it in button click method
[no name] 19-Dec-11 9:20am    
You should give complete information when you ask the question.

IMO, given this situation you should redesign the application to not show a popup when the page is loaded.
mridul samadder 19-Dec-11 9:34am    
this is the code registered in page from code behind as i said - $(document).ready(function () { window.open('mailto:?from=mridulcs@yahoo.com&subject=BID FEEDBACK - pro1&bcc=sdfdsf@hi.com,mridulcs@yahoo.com,mridulcs@yahoo.com','email'); }); so what change i can do in page load so that the script above does not shown again in page refresh??
mridul samadder 19-Dec-11 9:20am    
i found a solution at http://csharpdotnetfreak.blogspot.com/2009/09/detect-page-refresh-in-aspnet.html but is it best and error free?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900