Put Object In Session (VB.net)

monkeynote

Newcomer
Joined
Nov 17, 2007
Messages
10
hello guys! :)

i would like to ask if it is possible to put an object in session (global.asax)

im trying to migrate my classic asp code into VB.net and i successfully referenced my DCOM.

in my global.asa i only put this code to be accessible to all pages

<object runat="server" progid="pass" id="objectname" scope="session" > </object>

and here is my classic asp code

Code:
'Log In.asp
	if not isempty(request.form("buttLogIn")) then
		username 	= request.form("tbxUsername")
		password 	= request.form("tbxPassword")
		stat = objectname.chkUserID(username, password)
		if stat = "00" then
			response.write("Succesfully Logged In")
		else
			response.write("* Invalid Username / Password")
		end if
	end if

and here is my current ASP.net code together with my question remarks

Visual Basic:
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim username As String, password As String
        Dim stat As String
       
        'how to put this object in the global.asax?
        Dim epass As epasssoa.epasssoa = New epasssoa.epasssoa   

        If Request.Form("buttSubmit") <> "" Then
            username = Request.Form("boxUsername")
            password = Request.Form("boxPassword")
            If username <> "" And password <> "" Then
                stat = epass.chkUserID(username, password)
                If stat = "00" Then
                    Response.Write("Succesfully Logged In")
                Else
                    Response.Write("* Invalid Username / Password")
                End If
            End If
        End If
    End Sub

how can i put this object (epasssoa.epasssoa) into my global.asax? i tried to put it in the global.asax but i cannot access this object :(

i hope that you can help me with my problem.
 
Global.asax and session aren't really the same thing, if you wish to access the variable anywhere then you could just declare it as a shared variable.

If you are wanting to put it into the session then click here for some info from the msdn.
 
Back
Top