Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2007, 04:44 AM
Registered User
 
Join Date: Oct 2007
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Login control

Hi

At the moment out solution has a login page created using the Visual Studio Website Admin tool so an anon user can see a read only gridview and a user who logs in can see a gridview that has an edit option. That is all working fine however what we would like to do is have a user login in and depending on which section they are from for example HR, they only see records associated with HR and can only edit those records.

Can anyone point us in the right direction of how to go about setting this up?

Mucho thanks

 
Old October 10th, 2007, 07:08 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

One possible way to do this is to setup a roles table in your database that associates X role to a user logon and then execute a query specific query based upon the role the user is in.

Something like this would suffice

string role = "";
//execute scalar and assign the value to role

switch(role)
{
   case "HR":
       //Execute HR Query
       break;
   case "Payroll":
      //Execute Payroll Query
      break;
}

Alternatively you could combine the scalar step and the switch statement into a single stored procedure but I think it is overkill for what you are trying to do.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for:
Beginning Visual C# 2008
Professional Search Engine Optimization with ASP.NET
Professional IIS 7 and ASP.NET Integrated Programming
Wrox Blox: Introduction to Google Gears
Wrox Blox: Create Amazing Custom User Interfaces with WPF and .NET 3.0
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
login control hastikeyvan ASP.NET 3.5 Basics 1 May 7th, 2008 04:47 AM
Login Control p330418 ASP.NET 2.0 Basics 0 February 21st, 2008 01:03 AM
Login Control behavior wirerider ASP.NET 2.0 Professional 0 October 3rd, 2006 05:14 PM
Login Control Mahill ASP.NET 2.0 Basics 1 May 19th, 2006 02:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.