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

referencing an object inside a class definition

Hi,
I'm trying to define a class. In the class, I'm initializing one of its
private string variables with a value from an HTML form using something like:
'variable = Request.Form.Get("formVariable").ToString();'

However, I'm getting the error:

System.Web.UI.Page.Request denotes a property where a class was expected

What a m I doing wrong?

many thanks,

Pete
Nov 17 '05 #1
2 1581
try using the square brackets.

-Ab.
http://joehacker.blogspot.com

"Italian Pete" <It*********@discussions.microsoft.com> wrote in message
news:5B**********************************@microsof t.com...
Hi,
I'm trying to define a class. In the class, I'm initializing one of its private string variables with a value from an HTML form using something like: 'variable = Request.Form.Get("formVariable").ToString();'

However, I'm getting the error:

System.Web.UI.Page.Request denotes a property where a class was expected

What a m I doing wrong?

many thanks,

Pete

Nov 17 '05 #2
Italian Pete wrote:
I'm trying to define a class. In the class, I'm initializing one of its
private string variables with a value from an HTML form using something like:
'variable = Request.Form.Get("formVariable").ToString();'

However, I'm getting the error:

System.Web.UI.Page.Request denotes a property where a class was expected

What a m I doing wrong?


It's hard to say as you haven't shown much context. Could you provide a
short but complete example which demonstrates the problem?

See http://www.pobox.com/~skeet/csharp/complete.html

Jon

Nov 17 '05 #3

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

Similar topics

2
by: Lüpher Cypher | last post by:
Ok, here's what I'm trying to do. I have a class. Inside the class I have a method that reads a text file. In the text file I have a class name and a file name where that class is defined. Now, I...
28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
5
by: ganesh.gella | last post by:
Hi All, Wanted to make sure on this, I have some functions for which I am providing the definition inside the class definition. (As these are very small functions like get and set). Do i...
11
by: Milind | last post by:
Hi, I was trying to implement a composition relation, somthing of the following type: class A { public: class B {
12
by: Pollux | last post by:
I'm having trouble doing someting apparently simple. I'm still not very familiar with Visual Studio 2003, so apologies if I've missed something obvious. Basically my problem is the following. I...
13
by: Dan Bass | last post by:
Say I've got an ArrayList, which contains a list of integers. Is it possible to get a reference to one of the integers contained within the collection so that changes to it are reflected in the...
11
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
2
by: jordanp | last post by:
Hello, I'm having a little trouble here and I'm hoping that somebody might be able to help me out (win32 console program). First off, I know that I can use class function inside of my struct as...
0
by: DahrkDaiz | last post by:
Ok so I have a base class and several inherited classes. The base class has 3 Delegate Objects so that the inherited classes can redefine search functions (note, virtual will not work in this case)....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.