"Patrick.O .Ige" <PatrickOIge@discussions.microsoft.comwrote in message
news:7EADDAE7-5FBE-4271-B455-164D8872D216@microsoft.com...
Quote:
I want users to complete a webform or edit a page before getting to
a specific page.
The pages need to do the following:
1)Check to see if they need to edit or complete a form if YES then until
they complete it they can get to a specific page or URL. If not i sent
them
to the page they need to get to
2)But the thing is if a user is smart they can copy the url and paste it
directly.
And if they do that i want to throw them out .
How can i let a user get to the url unless they have done what i wanted.
Several ways, probably...
However, an extremely simple way would be to use a Session variable.
When a user first accesses the site (or logs in...) set a Session variable
e.g.
Session["CanProceed"] = false;
Then, once the user has done what you want, set the Session variable to
true;
On any page which they shouldn't access unless they have done what you want,
simply check the value of the Session variable, e.g.
protected Page_Init (object sender, EventArgs e)
{
if (!(bool)Session["CanProceed"])
{
Response.Redirect(MyOtherPage.aspx, false);
}
}
--
Mark Rae
ASP.NET MVP
http://www.markrae.net