Solved

asp.net visual web developer 2010

Posted on 2011-02-18
4
349 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

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…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
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…

737 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