Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 December 11th, 2006, 06:20 PM
su su is offline
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Include in C#

I am using C#.NET, Visual Web Developer and SQL Server 2000.

I would like to set variables per person/session.

I have declared session["User_login"] in my 1st file which is usersecurity.aspx. Using this I have also captured some values from database and stored into session for ex. session["EmpID"], Session["UserType"].

Now I want to use all these results in 2nd page which is orderlist.aspx. How to use it?

Do I have to include this file into my 2nd page? if yes, How to include file and use its result in C#?
 
Old December 13th, 2006, 01:47 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No - for one, thing, there is no such thing as "includes" in this context.
You can merely access the session variable via the Session object from any code in your project that has access to the request.

Woody Z
http://www.learntoprogramnow.com
 
Old December 15th, 2006, 04:59 AM
Friend of Wrox
 
Join Date: Feb 2006
Posts: 133
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to gaurav_jain2403
Default

Try something like this:

string login = (string)Sesion["User_login"] in the 2nd page i.e. orderlist.aspx

Gaurav





Similar Threads
Thread Thread Starter Forum Replies Last Post
c #include vicoldan Need help with your homework? 0 December 3rd, 2007 06:15 AM
USING INCLUDE FIEL jhan316 Beginning PHP 1 August 8th, 2006 08:01 AM
#include arielote C# 3 February 26th, 2006 07:54 PM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM
xsl:include within include chuck123ie XSLT 1 January 5th, 2006 11:07 AM





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