473,386 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

ASP.NET using C# Help using Sessions :(

HI i am working on a Project
where i have to send a string using Sessions["creditcardNR"]
to the next page this is working gud for now
But i can convert session["creditcardnr"] to a string the .ToString();
and the Convert.ToString(.....); is not workin

I am using Web Matrix .

Please Help me ASAP. tanx

here is some code

public void Page_Load(Object sender,EventArgs evt)
{
if(Session["AccNR"] == null)
Response.Redirect("Home.aspx");
Response.Write(Session["AccNR"]);
lblAccNR.Text = Session["AccNR"].ToString(); //<- Error ?
}
Jul 30 '07 #1
2 1255
jhardman
3,406 Expert 2GB
moved to .NET forum. You might get more help here.

Jared
Jul 31 '07 #2
TRScheel
638 Expert 512MB
Anything saved in the session is saved as an object. To retrieve it you need to cast it to string.

Expand|Select|Wrap|Line Numbers
  1. lblAccNR.Text = (string)Session["AccNR"];
Jul 31 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Marcin Jurczuk | last post by:
Hello group. Could someone descripe how to delete many row at one time from MySQL database using SkunkWeb PyDO pacgage ?? Documentation is very short about that ... Assume that Base is class...
3
by: Will Woodhull | last post by:
Hi, I'm new here-- I've been reading the group for a couple of days. Nice group; I like the way n00b33 questions are handled. I've been using a Javascript routine in index.html to determine a...
1
by: JDF | last post by:
I am fairly new to python and seem to have gotten ahead of myself. I am trying to write a Windows service that will return the current number of Citrix sessions to a client. This service will run...
2
by: Steve Franks | last post by:
According to the docs you tell ASP.NET to use cookieless sessions by setting a value in the config.web file. However, what if I wanted to determine at run time whether or not I wanted to use...
10
by: Anthony Williams | last post by:
Hi gang, This one looks like a bug :o( As you may or may not know, setting session management in web.config to use cookieless sessions causes the ASP.NET runtime to munge a session ID into...
6
by: Notgiven | last post by:
I am considering a large project and they currently use LDAP on MS platform. It would be moved to a LAMP platform. OpenLDAP is an option though I have not used it before. I do feel fairly...
4
by: news | last post by:
We have a huge PHP e-commerce site that relies totally on PHP sessions and cookies. We need to create a demo version of the site for potential clients to use that does NOT show the original URL in...
5
by: John Scott | last post by:
Ok..this a rather odd question/problem. I haven't really found a straight forward answer to how to handle this scenario, so I hope someone here can help. Here it is: I have an application...
9
by: viz | last post by:
hi, i have written a class for session handling, and i want to use it to keep track of the user. After authenticating the user in login page i am storing the session info like uname etc.. in a...
0
by: =?Utf-8?B?SmltIFdhbHNo?= | last post by:
I am a .NET newbie, specifically WinForms. I have a simple Winform for which I have a "How To" question: My WinForm app will display data from a FoxPro database, two tables in particular:...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.