473,388 Members | 1,340 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,388 software developers and data experts.

VB.Net: how to carry SessionID(its value ) from 1 function to othe

If I get SessionID in 1 function how do I carry that SessionID(value of this
SessionID) to another function or another form within the same project
Feb 21 '06 #1
2 3189
Winforms or webforms?

In Winforms, u can make the SessionID a public or internal property of the
form and in WebForms use the Session object to hold this value.

"XML newbie: Urgent pls help!"
<XM********************@discussions.microsoft.co m> wrote in message
news:43**********************************@microsof t.com...
If I get SessionID in 1 function how do I carry that SessionID(value of
this
SessionID) to another function or another form within the same project

Feb 21 '06 #2
I am using Vb.Net windows application and I logon to the remote server. Once,
I logon, I get the SessionID.

like.....
If Not HttpWResponse Is Nothing Then
Dim strm As Stream = HttpWResponse.GetResponseStream()
Dim encode As Encoding =
System.Text.Encoding.GetEncoding("utf-8")
Dim sr As New StreamReader(strm, encode)
'Dim XmlRead = New
XmlTextReader(HttpWResponse.GetResponseStream())
'xmlDoc.Load(XmlRead)
xmlDoc.Load(sr)
Return xmlDoc
Console.WriteLine("Response: {0}", sr.ReadToEnd())

Her, sr.Read to end goes like this:Response:<?xml version = '1.0'
encoding='iso-8859-1'><LoginResponse xmlns="
blahblah><status>success></status><SessionID>.....</SessionID></LoginResponse>

In my class, I declare

Dim g_SessionID As String

Now, I want to use this Session_ID in another function like this:
Private Sub btQueryAssetList_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btQueryAssetList.Click

Dim queryAssetListXml As String
Dim queryAssetListResponse As XmlDocument

queryAssetListXml = "<?xml version='1.0' ?>" & _
"<QueryAssetList2
xmlns=""urn:schemas-tms:QueryAssetList2"">" & _
"<SessionID>" & g_SessionID & "</SessionID>" & _
"</QueryAssetList2>"

queryAssetListResponse = SendXmlRequest(queryAssetListXml)

But, when I run the pgm I notice that I don't get the value of Session_ID
read/stored in the queryAssetListXml. How should I do this

I appreciate ur quick response and thanku in advance.
"Onawole, Clement Oladapo" wrote:
Winforms or webforms?

In Winforms, u can make the SessionID a public or internal property of the
form and in WebForms use the Session object to hold this value.

"XML newbie: Urgent pls help!"
<XM********************@discussions.microsoft.co m> wrote in message
news:43**********************************@microsof t.com...
If I get SessionID in 1 function how do I carry that SessionID(value of
this
SessionID) to another function or another form within the same project


Feb 22 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cheezebeetle | last post by:
ok, so I am having problems passing in an ASPX function into the Javascript in the codebehind page. I am simply using a confirm call which when they press "OK" they call this ASPX function, when...
2
by: Ralph Krausse | last post by:
How can I run a function in my javascript in ASP.NET but have the function defined in the codebehind file? Thanks Ralph Krausse www.consiliumsoft.com Use the START button? Then you need...
2
by: GeRmIc | last post by:
Hi, I am trying to write a .NET Class Library which generates an XML file from the input parameters of all the functions that are called in a C DLL. (Everytime the GUI call the C DLL's...
6
by: Jerome Cohen | last post by:
I need to implement a simple application that listens for web requests on a well-known URL, grab the request , which is an XML document, and send as respnse an XML document. each client sends a...
4
by: Rudy Mark | last post by:
I want to use HEX function of VB.Net in Visual Basic program. How to call VB.Net application from VB application. Is ther any way I can use this(HEX function) ? Thanks
1
by: David Sanschagrin | last post by:
(I previously posted this problem on vb.general.discussion but I've been told that this question is more related to VB.NET than VB6 and so that I should post that here.) I'm trying to call a...
4
by: Saber | last post by:
When users come to website, I want to identify them (browser, referrer, ....). I am doing it in global.asax, well, when they type www . sitename . com the global.asax identify them and redirect...
5
by: Kent.Gallinger | last post by:
I have a web application that contains asp.net and classic asp pages. I have a vb.net function that I would like to use in one of the classic asp pages. How can I do this? Can I do this? ...
1
by: ChrisFrohlich | last post by:
Is there a function I can use to bind to a web control on an ASP.NET 2.0 page if I have a string for the ID of the control? I'd like to be able to throw an ID string at a function and bind a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.