Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 1st, 2004, 02:03 PM
Authorized User
Join Date: Jul 2004
Location: , , .
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Session Variables to the Next Page

Hi All,

I'm not sure if this is a "ASP Professional" Question, so here it goes. I was asked to redirect this post to an ASP.NET Forum cause I posted to the ASP Database before. So I'm posting here and also at ASP.NET 1.1 because I don't know where to post this one:

I need some help passing session variables from my login page to the next page. This is what I am trying to do:

- When users of the Human Resources Department access the next few pages via a login page, I want them to only see a button that is for Human Resources.
- Conversely, when users of the Information Services Department access the next few pages via a login page, I want them to only see a button that is for Information Services.

The order of the pages is as follows:
1.) Login Page
2.) Default Thank You Page (telling users that the login was successful)
3.) User Interface Page (where the user, depending on which department they are from, can only view specific buttons that pertain to their department).

I thought I was doing it correctly with the following code for the 'User Interface Page':

<MM:If runat="server"
Expression='<%#(session("sessDepartment")="HR")%>' >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="108" height="46">
                      <param name="BGCOLOR" value="">
                      <param name="movie" value="HR Button (Dept Module).swf">
                      <param name="quality" value="high">
                      <embed src="HR Button (Dept Module).swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="108" height="46" ></embed>

On the page before (the 'Default Page'), I have the following script:

<script runat="server" language="VB">
Sub Page_Load()
End Sub

On the page before that, the 'Login Page', I have the following code which authenticates the Username. In my Access Database, I have two tables that are linked which should pull the Department that the username is from. Here is the Login Page code:
if dsLogin.RecordCount > 0 then
Session("sessUsername") = Request.Form("tfUsername")
FormsAuthentication.RedirectFromLoginPage("tfUsern ame.value", true)
else if ((Request.Form("tfUsername"))) <> Nothing _
OR ((Request.Form("tfPassword"))) <> Nothing
Response.Write("Login Failed. Please Try Again.")
end if

Any thoughts to why this is not working? Oh yeah, I'm using Dreamweaver as an application.

  #2 (permalink)  
Old August 1st, 2004, 06:25 PM
Friend of Wrox
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing session variables from login page. captainzorro Classic ASP Components 1 April 23rd, 2008 11:54 PM
Passing session variables from IIs to Tomcat aman thaper Internet Information Services 0 November 14th, 2006 09:34 AM
passing variables through session dmlocke Beginning PHP 4 May 4th, 2005 10:35 PM
Passing Session Variables to the Next Page jim.sullivan@telus.net Classic ASP Databases 2 August 1st, 2004 01:59 PM

All times are GMT -4. The time now is 07:04 AM.

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