473,327 Members | 2,090 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,327 software developers and data experts.

password protecting a page

Pardon my ignorance...I'm new to .NET...but I want a user to be forced
to submit login credentials before displaying a page. Is there a quick,
easy way to do this? Don't worry about verifying the ID/PW...that's
taken care of.

Thanks in advance.
May 3 '07 #1
4 1149
If you're on an IIS box, you can turn Windows Authentication on and have
them authenticate to the domain of the server (assuming an internal application).
If you're authenticating using forms via Membership, you can add a Login
control to your page (.NET 2.0+). This control, along with a bit of connecting
via your web.config and your SQL Server, will provide authentication and
authorization functionality.

If you simply just want them to type in SOMETHING, then two text boxes and
a button with a function in the code to verify the input.

Or something else? You mention that the authentication (verifying) is taken
care of, but with no insight how... if you have a secondary user control/web
service for this, then a couple text boxes may be what you're looking for
(opting for simplicity).

HTH.

-dl

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com
Pardon my ignorance...I'm new to .NET...but I want a user to be forced
to submit login credentials before displaying a page. Is there a
quick, easy way to do this? Don't worry about verifying the
ID/PW...that's taken care of.

Thanks in advance.

May 3 '07 #2
Thanks for your response. The purpose is to prevent unauthorized users
from seeing a particular page. My client simply wants to use hard-coded
ID/PW values. The only way to get to the page is by entering the url.
Ideally, a dialog box prompting for credentials is the way to do this,
as opposed to an additional page. Does your second paragraph accomplish
this?
David Longnecker wrote:
If you're on an IIS box, you can turn Windows Authentication on and have
them authenticate to the domain of the server (assuming an internal
application).

If you're authenticating using forms via Membership, you can add a Login
control to your page (.NET 2.0+). This control, along with a bit of
connecting via your web.config and your SQL Server, will provide
authentication and authorization functionality.

If you simply just want them to type in SOMETHING, then two text boxes
and a button with a function in the code to verify the input.

Or something else? You mention that the authentication (verifying) is
taken care of, but with no insight how... if you have a secondary user
control/web service for this, then a couple text boxes may be what
you're looking for (opting for simplicity).

HTH.

-dl

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com
>Pardon my ignorance...I'm new to .NET...but I want a user to be forced
to submit login credentials before displaying a page. Is there a
quick, easy way to do this? Don't worry about verifying the
ID/PW...that's taken care of.

Thanks in advance.

May 3 '07 #3

"Phil Hellmuth" <bi*****@pacbell.netwrote in message
news:46**************@pacbell.net...
Thanks for your response. The purpose is to prevent unauthorized users
from seeing a particular page. My client simply wants to use hard-coded
ID/PW values. The only way to get to the page is by entering the url.
Ideally, a dialog box prompting for credentials is the way to do this, as
opposed to an additional page. Does your second paragraph accomplish
this?
David Longnecker wrote:
>If you're on an IIS box, you can turn Windows Authentication on and have
them authenticate to the domain of the server (assuming an internal
application).

If you're authenticating using forms via Membership, you can add a Login
control to your page (.NET 2.0+). This control, along with a bit of
connecting via your web.config and your SQL Server, will provide
authentication and authorization functionality.

If you simply just want them to type in SOMETHING, then two text boxes
and a button with a function in the code to verify the input.

Or something else? You mention that the authentication (verifying) is
taken care of, but with no insight how... if you have a secondary user
control/web service for this, then a couple text boxes may be what you're
looking for (opting for simplicity).

HTH.

-dl

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com
>>Pardon my ignorance...I'm new to .NET...but I want a user to be forced
to submit login credentials before displaying a page. Is there a
quick, easy way to do this? Don't worry about verifying the
ID/PW...that's taken care of.

Thanks in advance.
If you are just looking for a simple roll your own method you could check
for a session item on the page load and if it does not exist then redirect
to the logon page (which when filled in correctly would redirect them to the
page which is password protected. It would also create the session item so
that subsequent visits to the page in the session would not need to be
revalidated.

Hope this helps.

Lloyd Sheen

May 3 '07 #4
You can use the Authentication tools built into ASP.NET to match to stored
static values, located in your web.config or a database table. Here's a
brief walkthrough provided by Peter Bromberg:

http://www.eggheadcafe.com/tutorials...thenticat.aspx

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com
"Phil Hellmuth" <bi*****@pacbell.netwrote in message
news:46**************@pacbell.net...
>Thanks for your response. The purpose is to prevent unauthorized
users from seeing a particular page. My client simply wants to use
hard-coded ID/PW values. The only way to get to the page is by
entering the url. Ideally, a dialog box prompting for credentials is
the way to do this, as opposed to an additional page. Does your
second paragraph accomplish this?

David Longnecker wrote:
>>If you're on an IIS box, you can turn Windows Authentication on and
have them authenticate to the domain of the server (assuming an
internal application).

If you're authenticating using forms via Membership, you can add a
Login control to your page (.NET 2.0+). This control, along with a
bit of connecting via your web.config and your SQL Server, will
provide authentication and authorization functionality.

If you simply just want them to type in SOMETHING, then two text
boxes and a button with a function in the code to verify the input.

Or something else? You mention that the authentication (verifying)
is taken care of, but with no insight how... if you have a secondary
user control/web service for this, then a couple text boxes may be
what you're looking for (opting for simplicity).

HTH.

-dl

---
David R. Longnecker
Web Developer
http://blog.tiredstudent.com
Pardon my ignorance...I'm new to .NET...but I want a user to be
forced to submit login credentials before displaying a page. Is
there a quick, easy way to do this? Don't worry about verifying
the ID/PW...that's taken care of.

Thanks in advance.
If you are just looking for a simple roll your own method you could
check for a session item on the page load and if it does not exist
then redirect to the logon page (which when filled in correctly would
redirect them to the page which is password protected. It would also
create the session item so that subsequent visits to the page in the
session would not need to be revalidated.

Hope this helps.

Lloyd Sheen

May 4 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: edd | last post by:
Ive seen a few examples of how to password protect my pages by either textfiles / access. But how can I make the pages so that no one can just enter the url and bypass the login page. Im trying...
9
by: Ben Allen | last post by:
Hi, I want to create a password protected page to administer my site from (the news is read from a mySQL database and I have created a PHP form to as a GUI to do this). I thought of...
5
by: nick | last post by:
I need to create a simple asp.net application that use password protect some html pages. The html page provider doesn't know asp.net. And the host doesn't allow me to create user accounts. ...
3
by: Miro | last post by:
Why Password protect an MDB when someone can google and get a hack? Wondering if anyone else has thought of this and just said "oh well"... I plan to password protect an MDB where I have some...
8
djsjm
by: djsjm | last post by:
Hello again. So I googled myself into finding this code: <?php // Define your username and password $username = "someuser"; $password = "somepassword"; if ($_POST != $username || $_POST...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.