Ask a Question related to ASP.NET General, Design and Development.
-
Rajesh Abraham #1
Session Variables & C# Casting
I am new to Asp world and I have a doubt as follows. I
have a class called objTranslator, which I declare and
initiate global.asax as follows.
Session_Start
csTranslator.objTranslator sesObjTranslator= new
objTranslator();
Session["sesTranslator"]=sesObjTranslator;
----------------
Now in WebForm
private csTranslator.objTranslator webTranslator;
In Page Load
if(Session["sesTranslator"]!=null)
webTranslator=(objTranslator)Session["sesTranslator"];
The question is why do I have to explictly cast the
session variable sesTransilator to objTransilator while it
is holding a reference to sesObjTranslator.
So actually what type is the session variable.
In VB.Net one can directly use
webTranslator=Session("sesTranslator")
What is the difference here?
Thanks,
Rajesh Abraham Chacko
Rajesh Abraham Guest
-
#39833 [NEW]: Session variables overwritten by local variables (register_globals=off)
From: sup1382 at accedo dot es Operating system: OpenBSD 3.9 PHP version: 5.2.0 PHP Bug Type: Session related Bug... -
#39447 [NEW]: Want to optionally handle apc_upload_progress variables using session variables
From: krudtaa at yahoo dot com Operating system: All PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug... -
PHP Session variables
I am trying to create a site where users login and view their account details. I have successfully created a login/register page. The problem is... -
Session problem when setting session variables in files that are in different directories
I am running PHP 4.3.0 on a WinXPpro machine and I recently got problem with sessions. What I am building is a loginsystem and I need to save... -
variables that change session variables
Hi, I'm currently writing a mulit-page form app that uses a session to retain data from each form element in order for the user to jump between...



Reply With Quote

