473,395 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Executing a validating query before loading a page

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
2 1259
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Jay O'Connor | last post by:
Is there a good way to import python files without executing their content? I'm trying some relfection based stuff and I want to be able to import a module dynamically to check it's contents...
7
by: Rick Caborn | last post by:
Does anyone know of a way to execute sql code from a dynamically built text field? Before beginning, let me state that I know this db architecture is built solely for frustration and I hope to...
2
by: and | last post by:
Hi I have been validating all day most things are cool but I cant get by this problem. One I have listed the script (JAVASCRIPT ) in all the right placesnot a prob but the validator insists...
4
by: seans | last post by:
Hi, Is there some way from preventing the JavaScript code in a document loaded into an iframe from executing? I don't have access to the pages being loaded into the i-frame so I can't modify...
2
by: Patrick.O.Ige | last post by:
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...
1
by: Cesar | last post by:
Hello, I've developed a .NET C# web service; which has one method named, let's say, upload_your_data. This method has one parameter ( string your_data). The value that this parameter will...
7
by: tshad | last post by:
I thought I understood how the SaveViewState is working and was trying to use this (as per some code I found) to detect refreshes. It seemed to be working but I found that the SaveViewState was...
2
by: Baron Samedi | last post by:
My whole site is PHP. That means that there are various includes which make up each page so that I can have standard headers/footers/menu, etc If the content of one of these changes, it might break...
24
by: runway27 | last post by:
i have used the following code to validate the username it is working fineif( $username == "" || !preg_match("/^+(?:_+)?$/i", $username) ) { $error.="User name cannot be blank or has special...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.