Solved

asp.net visual web developer 2010

Posted on 2011-02-18
4
348 Views
Last Modified: 2012-05-11
I have just started to work with VWD 2010 and am looking to restrict access to pages depending on whether the user is logged in or not, i.e. if the login page is login.aspx and the content page is content.aspx, the user cannot just type content.aspx and access the content, they are redirected to login.aspx.

I used to use Dreamweaver with php and there was an extension that achieved this, I think through sessions.

Is there a simple way to achieve this?

Many thabks,

Keith
0
Comment
Question by:kalees
  • 2
4 Comments
 
LVL 9

Expert Comment

by:RobertNZana
ID: 34926443
If you want to write code it's fairly easy. In your login page, if the person logs in correctly set a session var, such as session("LoggedIn") = True. In the Page_Load of your content page if session("LoggedIn") <> true then redirect to the login page.

Alternatively you could stick the content page in a members-only type directory with a web.config that restricts access. If you are using the built in stuff it should work well. For example...
<authorization>
    <allow users="user1, user2"/>
    <deny users=”?”/>
</authorization>

http://support.microsoft.com/kb/815151

Hope this helps!
0
 

Author Comment

by:kalees
ID: 34926772
Robert,

I am not against coding at all, is it possible to offer more advice on how to set up the session in the loggin page? I am currently using the login control in VWD.

Keith
0
 
LVL 3

Expert Comment

by:chrisrbloom
ID: 34927609
Use the video tutorials on ASP.NET.

That's how I started, I was where you are now a few years ago.  Just take the time to watch the videos and you'll be set.

http://www.asp.net/web-forms
0
 
LVL 9

Accepted Solution

by:
RobertNZana earned 500 total points
ID: 34930578
Check this out for the login (and related) control: http://msdn.microsoft.com/en-us/library/ms178329.aspx

This will help too: http://www.beansoftware.com/ASP.NET-Tutorials/Authorization-Authentication-Registration.aspx

You shouldn't have to write any code for this. Thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question