Solved

asp.net visual web developer 2010

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now