Executing a validating query before loading a page

Discussion in 'ASP .Net' started by Patrick Olurotimi Ige, Jan 27, 2005.

  1. 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!
    Patrick Olurotimi Ige, Jan 27, 2005
    #1
    1. Advertising

  2. Patrick Olurotimi Ige

    Ollie Riches Guest

    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" <> wrote in message
    news:#...
    > 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!
    Ollie Riches, Jan 27, 2005
    #2
    1. Advertising

  3. Patrick Olurotimi Ige

    IPGrunt Guest

    Patrick Olurotimi Ige <> confessed in news:
    #:

    > 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
    IPGrunt, Jan 27, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Strøiman
    Replies:
    2
    Views:
    665
    Peter Strøiman
    Oct 28, 2003
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    validating user before loading a page?

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Jan 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    356
    Patrick Olurotimi Ige
    Jan 27, 2005
  3. Eric Livingston

    Executing client script before page load

    Eric Livingston, Jan 23, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    797
    Eric Livingston
    Jan 23, 2008
  4. Mark Anderson

    Executing code before page load complete...

    Mark Anderson, Oct 23, 2003, in forum: Javascript
    Replies:
    2
    Views:
    266
    Mark Anderson
    Oct 23, 2003
  5. max
    Replies:
    0
    Views:
    113
Loading...

Share This Page