Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Object defining question(Need a Quick Answer!)

Posted on 2003-11-24
4
421 Views
Last Modified: 2006-11-17
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!
0
Comment
Question by:KMTran33
4 Comments
 
LVL 4

Accepted Solution

by:
krznpsk earned 500 total points
ID: 9814817
Is this an ASP.NET application?  If so, then you should remove the line "Dim Session as New Object," because Session is an object that's constantly in scope.

Object is not a type that you can index into, however, the "Session" object is.
0
 
LVL 9

Expert Comment

by:malharone
ID: 9814839
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"))
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10277179
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
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question