You are saving data in db? if your are then you should have primary key, which raise error on voilation, other then if only on page you
can create a one check on page load and save it on the view state, if that check is zero then you can save values otherwise not allow form to use your funciton.
<div align="LEFT">Also, in the code behind, apply a token pattern, maybe in a session variable named IsAuthorized and set it to true. Once the token has been used, set the session variable to false then any preceding logic will not run anymore even if they
press back multiple times.</div>
shahid.majee...
Member
620 Points
543 Posts
how we can stop a user to go back to the page.
May 07, 2012 01:48 PM|LINK
Hello,
I have a problem, when user save data in a form and then save confirmation message appear in an other page.
after that a user just click back button in the page and then save the same data. so its make the double entery.
Is there any way to stop this user behaviour.
Shahid Majeed
Email: shahid.majeed@gmail.com
azizi021@hot...
Member
96 Points
24 Posts
Re: how we can stop a user to go back to the page.
May 07, 2012 02:06 PM|LINK
You are saving data in db? if your are then you should have primary key, which raise error on voilation, other then if only on page you
can create a one check on page load and save it on the view state, if that check is zero then you can save values otherwise not allow form to use your funciton.
hope this may help you.
BizTalk & SharePoint Developer
amosCabanban...
Member
441 Points
142 Posts
Re: how we can stop a user to go back to the page.
May 07, 2012 02:17 PM|LINK
Try this
<html xmlns="http://www.w3.org/1999/xhtml" >
<div align="LEFT">Also, in the code behind, apply a token pattern, maybe in a session variable named IsAuthorized and set it to true. Once the token has been used, set the session variable to false then any preceding logic will not run anymore even if they press back multiple times.</div><head runat="server">
<title>New event</title>
</head>
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</SCRIPT>
</HEAD>
<BODY onload="noBack();"
onpageshow="if (event.persisted) noBack();" onunload="">
<a href='page2.html' >Page 2</a>
</body>
</html>
budugu
All-Star
41108 Points
6019 Posts
Re: how we can stop a user to go back to the page.
May 07, 2012 02:17 PM|LINK
Here is a way of doing it.. http://www.4guysfromrolla.com/webtech/100406-1.shtml
"Don't be afraid to be wrong; otherwise you'll never be right."
Nasser Malik
Star
10980 Points
1691 Posts
Re: how we can stop a user to go back to the page.
May 07, 2012 02:34 PM|LINK
see
http://www.codeproject.com/Articles/11225/Disabling-browser-s-back-functionality-on-sign-out
you can disable browser's back button
http://www.codeproject.com/Answers/252142/How-to-disable-browsers-back-button.aspx#answer1
http://viralpatel.net/blogs/2009/11/disable-back-button-browser-javascript.html
http://stackoverflow.com/questions/961188/disable-browsers-back-button
Skype: maleknasser1
sriramabi
Contributor
4351 Points
1277 Posts
Re: how we can stop a user to go back to the page.
May 07, 2012 02:37 PM|LINK
hai
try this alert in u r save functionality end time
string script = "alert('Scores are inserted successfully');window.location ='Default.aspx';";
ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", script, true);
thank u