Solved

asp.net visual web developer 2010

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

929 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

13 Experts available now in Live!

Get 1:1 Help Now