|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Pass SessionID from 1 fn to otherHow should I pass the SessionID(when I logon, I get the SessionID) from 1
function to another in VB.Net. I declared g_SessionID globally, then in another function, I take SessionID as input and use it like this: queryAssetListXml = "<?xml version='1.0' ?>" & _ "<QueryAssetList2 xmlns=""urn:schemas-tms:QueryAssetList2"">" & _ "<SessionID>" & g_SessionID & "</SessionID>" & _ "</QueryAssetList2>"But, I notice that even I get the SessionID , SessionID still remains Null.Any idea? It seems...
a) you are programming under ASP.NET b) both functions are called in separate pages Here are a few hints: * HTTP is a stateless protocoll, means everything not stored in Session[] or Application[] gets lost after each page request. * The Session object is available from *any* page in your web application and even from within classes outside using the static HttpContetxt.Current.Session object. So there is no need to store it anywhere. * Using global variables is bad programming style. HTH, www.sportboatcharter.com Axel Dahmen -------------------------- "XML newbie: Urgent pls help!" <XMLnewbieUrgentplsh***@discussions.microsoft.com> schrieb im Newsbeitrag Show quote news:FCC995DB-4282-42A3-B167-78B74B28FC55@microsoft.com... > How should I pass the SessionID(when I logon, I get the SessionID) from 1 > function to another in VB.Net. > > I declared g_SessionID globally, then in another function, I take SessionID > as input and use it like this: > queryAssetListXml = "<?xml version='1.0' ?>" & _ > "<QueryAssetList2 > xmlns=""urn:schemas-tms:QueryAssetList2"">" & _ > "<SessionID>" & g_SessionID & "</SessionID>" & _ > "</QueryAssetList2>" > > > But, I notice that even I get the SessionID , SessionID still remains > Null.Any idea? > I am using VB.Net
Show quote "Axel Dahmen" wrote: > It seems... > > a) you are programming under ASP.NET > b) both functions are called in separate pages > > Here are a few hints: > > * HTTP is a stateless protocoll, means everything not stored in Session[] or > Application[] gets lost after each page request. > > * The Session object is available from *any* page in your web application > and even from within classes outside using the static > HttpContetxt.Current.Session object. So there is no need to store it > anywhere. > > * Using global variables is bad programming style. > > HTH, > www.sportboatcharter.com > Axel Dahmen > > > -------------------------- > "XML newbie: Urgent pls help!" > <XMLnewbieUrgentplsh***@discussions.microsoft.com> schrieb im Newsbeitrag > news:FCC995DB-4282-42A3-B167-78B74B28FC55@microsoft.com... > > How should I pass the SessionID(when I logon, I get the SessionID) from 1 > > function to another in VB.Net. > > > > I declared g_SessionID globally, then in another function, I take > SessionID > > as input and use it like this: > > queryAssetListXml = "<?xml version='1.0' ?>" & _ > > "<QueryAssetList2 > > xmlns=""urn:schemas-tms:QueryAssetList2"">" & _ > > "<SessionID>" & g_SessionID & "</SessionID>" & > _ > > "</QueryAssetList2>" > > > > > > But, I notice that even I get the SessionID , SessionID still remains > > Null.Any idea? > > > > > > > |
|||||||||||||||||||||||