Showing posts with label passing. Show all posts
Showing posts with label passing. Show all posts

Thursday, March 29, 2012

Session variable

Hi Team,

I am using one Session variable to passing data between method in one page. For example: I am using Session["SourceType"] variable, which the value always changing depends on where the user want to view the content.

My question is, when I store another value into the same session variable (Session["SourceType"]) name, do I need to delete/remove first the old value or it will just overwritten the old value.

I hope that my question is clear and thanks in advance.

You can simply overwrite the old value when using Session variables. Just remember to cast it to proper type when reading it back.
It will overwrite it.

it will overwrite the data if used like Session["sourceType"] = "new value"

however if you have the SourceType variable set and try to go

Session.Add("sourceType","value"); it will cause an error.

hth,

mcm


Thanks team,

So it means that the old value will be removed right. Because I don't want the old value just floating around the applications.

Thanks.


yes,

the .net Garbage Collector will remove the old value from memory when you assign the same variable another value.

mcm

Monday, March 26, 2012

Session Variable not passed to new window

I have a number of Session variables that are not passing to a new
window. It is only happeneing on one user's computer and only under
her profile. Methods are called to obtain these values and re-assign
them to the Session if they = Nothing, except the UserID variable. If
this value is nothing then the window is closed and they are taken to
the login page.
I don't want to re-write the app to obtain this variable from another
method. So I've been busting my brain trying to find a way to write
the "UserID" value to a hidden input control and some how passing that
to the new window, but I can't get the server to see this value.
Any thoughts?bump

Session Variable not passed to new window

I have a number of Session variables that are not passing to a new
window. It is only happeneing on one user's computer and only under
her profile. Methods are called to obtain these values and re-assign
them to the Session if they = Nothing, except the UserID variable. If
this value is nothing then the window is closed and they are taken to
the login page.
I don't want to re-write the app to obtain this variable from another
method. So I've been busting my brain trying to find a way to write
the "UserID" value to a hidden input control and some how passing that
to the new window, but I can't get the server to see this value.
Any thoughts?bump

Thursday, March 22, 2012

Session Variables

Hi all,
We seem to be having a problem passing session variables from a page in ASP to a page written in .Net (aspx).
What is the generally accepted solution to this issue?
Thanks in advanceSession states are not shared between ASP and ASP.NET pages.

Simplest solution is to convert all asp pages which employ session variables into ASP.NET pages, alternatively you could encrypt your session variables into cookies.

All the best.

Tuesday, March 13, 2012

Session Variables and SSL

Hi Al,

Got over the issue on passing variabels on to a page on an SSL server.......

but heres the question...can I use ... a session variable going form https://www.mysite.com/page1.aspx to https://www.mysite.com/page2.aspx

do they work as long as I saty in the same domain ont he same server in the ssl folder?

rgs

Tonysession variable going form https://www.mysite.com/page1.aspx to https://www.mysite.com/page2.aspx ?

Yes, Session variables will work in above problem.

As session variables are maintained by server So it will work in same server.