Link to home
Start Free TrialLog in
Avatar of KMTran33
KMTran33

asked on

Object defining question(Need a Quick Answer!)

code:

Dim EnteredID As String, EnteredPW As String
Dim Session As New Object

        Session("Employee_ID") = txtName.Text
        Session("Employee_Password") = txtPassword.Text
        EnteredID = Trim(txtName.Text)
        EnteredPW = Trim(txtPassword.Text)


I keep getting this error message:

No default member found for type 'Object'

What am I missing?  I just need a quick answer............Thanks!
ASKER CERTIFIED SOLUTION
Avatar of krznpsk
krznpsk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of malharone
malharone

to store info in session, you don't need to create a new session object. it already has been created to you.

Dim EnteredID As String, EnteredPW As String  <---- just for the sake of clarity, separate in 2 lines
Dim Session As New Object    <---- Object is NON instantiable class ... e.g. you can't really create a new OBJECT.

        Session("Employee_ID") = txtName.Text
        Session("Employee_Password") = txtPassword.Text
        EnteredID = Trim(txtName.Text)
        EnteredPW = Trim(txtPassword.Text)


CORRECTED/SUGGESTED
-------------------------------------

Dim EnteredID As String
Dim EnteredPW As String

'Storage
Session("Employee_ID") = txtName.Text
Session("Employee_Password") = txtPassword.Text
EnteredID = Trim(txtName.Text)
EnteredPW = Trim(txtPassword.Text)

'--------------

'retrieval ...

response.write(session("Employee_ID"))
Avatar of Bob Learned
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: krznpsk {http:#9814817}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer