Solved

asp.net visual web developer 2010

Posted on 2011-02-18
4
351 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

615 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