Click here to Skip to main content
15,881,588 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: i want to see "web form designer generated code" in dotnet 2.0 Pin
Khawar Abbas111-Jul-06 23:42
Khawar Abbas111-Jul-06 23:42 
QuestionDatagrid footer Pin
kuwl_mark11-Jul-06 20:06
kuwl_mark11-Jul-06 20:06 
QuestionRSS Feed Code Pin
Amit Agarrwal11-Jul-06 20:04
Amit Agarrwal11-Jul-06 20:04 
AnswerRe: RSS Feed Code Pin
minhpc_bk11-Jul-06 21:55
minhpc_bk11-Jul-06 21:55 
QuestionUsing Outlook in ASP.Net Pin
aaraaayen11-Jul-06 19:53
aaraaayen11-Jul-06 19:53 
AnswerRe: Using Outlook in ASP.Net Pin
Saifi Hasan11-Jul-06 23:03
Saifi Hasan11-Jul-06 23:03 
GeneralRe: Using Outlook in ASP.Net Pin
aaraaayen12-Jul-06 0:11
aaraaayen12-Jul-06 0:11 
QuestionRoles and logins? Pin
kbalias11-Jul-06 19:41
kbalias11-Jul-06 19:41 
Hi
I am using Visual Studio 2003 and SQL Server 2000 to try and develop an E-Commerce website. Amongst others I have a Customers table, Suppliers table and a Roles table in the database. What is the standard procedure regarding storing usernames and passwords? At the moment I have Username and Password columns, as well as a foreign key column to the Roles table, in the Customers table as well as in the Suppliers table.

On my login page I have two radiobuttons so the user can specify whether they are logging in as a Customer or a Supplier. That determines then in which table I go to check the username and password. If the user is a valid user, the following line of code runs:

FormsAuthentication.RedirectFromLoginPage(userIndex.ToString(), ChkRemember.Checked);


The problem is that then I do not know how to use the Application_AuthenticateRequest() method in the Global.asax.cs. How would I specify in there which database table to be accessed to retrieve the roles? I tried using session variables, but they were not accepted in the Application_AuthenticateRequest() method.

protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
	//??? How to specify here which table to access
	string[] roles = Access_Customers.GetCustomerRoles(HttpContext.Current.User.Identity.Name);
	HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity, roles);
}

Am I missing the point completely here? Is there a better way of approaching this? Perhaps have all login data (usernames and passwords in one table)?

What is better from a security point of view to use in authentication and authorization: Cookies or Session variables?

Thanks.

Kobus
AnswerRe: Roles and logins? Pin
kumarprabhakar7411-Jul-06 22:09
kumarprabhakar7411-Jul-06 22:09 
Questionreturning values form jagged arrays Pin
mehnazash11-Jul-06 19:00
mehnazash11-Jul-06 19:00 
AnswerRe: returning values form jagged arrays Pin
Guffa11-Jul-06 20:55
Guffa11-Jul-06 20:55 
QuestionDoubt In Datalist Pin
Vipin Venugopal11-Jul-06 18:05
Vipin Venugopal11-Jul-06 18:05 
AnswerRe: Doubt In Datalist Pin
minhpc_bk11-Jul-06 21:58
minhpc_bk11-Jul-06 21:58 
QuestionArrgghh! How to disable vs automatically adding style settings for controls? Pin
Member 9611-Jul-06 12:03
Member 9611-Jul-06 12:03 
AnswerRe: Arrgghh! How to disable vs automatically adding style settings for controls? Pin
minhpc_bk11-Jul-06 22:01
minhpc_bk11-Jul-06 22:01 
GeneralRe: Arrgghh! How to disable vs automatically adding style settings for controls? Pin
Member 9612-Jul-06 5:18
Member 9612-Jul-06 5:18 
QuestionHow to send client side data to server side using any method(hidden field or AJAX) Pin
B Desai11-Jul-06 11:55
B Desai11-Jul-06 11:55 
AnswerRe: How to send client side data to server side using any method(hidden field or AJAX) Pin
minhpc_bk11-Jul-06 22:05
minhpc_bk11-Jul-06 22:05 
QuestionRegularExpressionValidator make me crazy! Pin
tranky11-Jul-06 10:19
tranky11-Jul-06 10:19 
AnswerRe: RegularExpressionValidator make me crazy! Pin
Dustin Metzgar11-Jul-06 10:35
Dustin Metzgar11-Jul-06 10:35 
AnswerRe: RegularExpressionValidator make me crazy! Pin
minhpc_bk11-Jul-06 11:58
minhpc_bk11-Jul-06 11:58 
QuestionAbsolute positioning ( CSS ) and updating problems in Visual Studio 2005 Pin
tedhill1311-Jul-06 10:14
tedhill1311-Jul-06 10:14 
AnswerRe: Absolute positioning ( CSS ) and updating problems in Visual Studio 2005 Pin
Guffa11-Jul-06 11:36
Guffa11-Jul-06 11:36 
GeneralRe: Absolute positioning ( CSS ) and updating problems in Visual Studio 2005 Pin
tedhill1312-Jul-06 7:47
tedhill1312-Jul-06 7:47 
GeneralRe: Absolute positioning ( CSS ) and updating problems in Visual Studio 2005 Pin
tedhill1312-Jul-06 8:09
tedhill1312-Jul-06 8:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.