Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 June 23rd, 2004, 03:56 PM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session States, Global. asax and web.config

Hi,

I recently built a ASP.NET application with security features (form authentication against a sql server 2000 username/password table) it works fine. However, there is another table containing information specific to the authenticated user. I set up a datagrid that shows me this information but I want to be able to filter this information for this user so that he/she see only data related to his user account immediately after logging in.
How can I pass the password from the login page to the sql statement for the datagrid?

I know I have to use session states but I'm not too sure how to implement them. Can someone point me to an example? I'm trying to figure out how to correctly write the global.asax page and the web.config file, and also what directive is required on each web page of my application. I'm somewhat of a newbie so forgive me if all of this sounds elementary.

thank you



 
Old June 29th, 2004, 07:14 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Set the session in the login page and use that session value for filtering the information.

Eg.Session["username"]=txtUserName.Text; in the login page set the session like this..
 And for query select * from tbl where username=Session["username"];


 
Old July 1st, 2004, 09:15 AM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you. I'll give it a try!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Global.Asax Session_End and Session.SessionID MissHenesy ASP.NET 2.0 Professional 7 November 3rd, 2009 01:20 AM
How to declare the global variable in global.asax? calyn_gately ASP.NET 3.5 Basics 0 August 6th, 2008 08:06 PM
Remote-obj under IIS and Web.Config + Global.asax lok_tan .NET Framework 2.0 1 March 17th, 2008 01:21 AM
Calling web page from Global.asax nitinp ASP.NET 1.0 and 1.1 Professional 3 August 27th, 2007 08:25 PM





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