By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,537 Members | 1,471 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,537 IT Pros & Developers. It's quick & easy.

Executing a validating query before loading a page

P: n/a
Is it possible to execute a query or do some validation before loading a
page..
I have a survey page and i want to validate users before loading the
page.
I have done it in the page_load.
But the problem i have is that if the user gets the URL and directly
paste it to the browser the USER still sees the page.
Is there a way how to check the user in the DB before loading the page
(I mean just by pasting the URL to the browser or just by clicking the
IE browser?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
simple answer would be no....

why can't you attempt to validate the user and if they don't have the
credentials then redirect then to another page.

HTH

Ollie Riches
"Patrick Olurotimi Ige" <ig*@iprimus.com.au> wrote in message
news:#K**************@TK2MSFTNGP11.phx.gbl...
Is it possible to execute a query or do some validation before loading a
page..
I have a survey page and i want to validate users before loading the
page.
I have done it in the page_load.
But the problem i have is that if the user gets the URL and directly
paste it to the browser the USER still sees the page.
Is there a way how to check the user in the DB before loading the page
(I mean just by pasting the URL to the browser or just by clicking the
IE browser?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #2

P: n/a
Patrick Olurotimi Ige <ig*@iprimus.com.au> confessed in news:
#K**************@TK2MSFTNGP11.phx.gbl:
Is it possible to execute a query or do some validation before loading a
page..
I have a survey page and i want to validate users before loading the
page.
I have done it in the page_load.
But the problem i have is that if the user gets the URL and directly
paste it to the browser the USER still sees the page.
Is there a way how to check the user in the DB before loading the page
(I mean just by pasting the URL to the browser or just by clicking the
IE browser?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Yes, you use dotnet's authentication and authorization features.

You need a statement like this in your Web.config:

<system.web>
<authentication mode="Forms">
<forms name="LoginForm" loginUrl="Login.aspx" />
</authentication>
</system.web>

and another to setup authorization:

<location path="YourFile.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
the deny users=? means that only authenticated users have access to the
file. Anonymous users will be redirected to your login page.

-- ipgrunt
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.