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

Beginner Mistake

I am trying to display a string located in my code behind page. I have
tried accessing the variable directly, and also as a Property. Every
time I recieve the following error:

CS0201: Only assignment, call, increment, decrement, and new object
expressions can be used as a statement

This is the html:

<td style="WIDTH: 703px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 28px"
width="703" background= "<%FirstTD;%>" >

And this is the code:

public string FirstTD
{
get
{
if(Request.QueryString["style"]=="children")
firstTD = "images/bg_kathy_template_r2_c2.gif";
else
firstTD = string.Empty;
return firstTD;
}
}
Any ideas. I know this is basic, but I would really appreciate any input.

Nov 17 '05 #1
1 1719
I answered my own question, thanks anyway

Jesse wrote:
I am trying to display a string located in my code behind page. I have
tried accessing the variable directly, and also as a Property. Every
time I recieve the following error:

CS0201: Only assignment, call, increment, decrement, and new object
expressions can be used as a statement

This is the html:

<td style="WIDTH: 703px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 28px"
width="703" background= "<%FirstTD;%>" >

And this is the code:

public string FirstTD
{
get
{
if(Request.QueryString["style"]=="children")
firstTD = "images/bg_kathy_template_r2_c2.gif";
else
firstTD = string.Empty;
return firstTD;
}
}
Any ideas. I know this is basic, but I would really appreciate any input.


Nov 17 '05 #2

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

Similar topics

44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
15
by: PhilB | last post by:
Hello experts, I am a complete beginner in C++ (although I know C). I am trying to compile the code below, and I get the following error. Can anyone explain to me my mistake? Thanks! PhilB ...
2
by: Tan Tze Yong | last post by:
Dear all, I am tasked to write a program in C++ recently. However my knowledge in C++ is very limited. What happened is I am storing serveral vectors in a map. I need to retrieve the vector from...
19
by: What-a-Tool | last post by:
I have a school project (ASP) in which I have to call three different ASP pages from three different and identical (except for the form "action", obviously) HTM pages. This I have no problem with....
10
by: Madame Blablavatsky | last post by:
hello, i have a few links on a page. when one clicks a link an pop up window with an image opens. when people click an other link i want the already availible pop up window to close before the...
5
by: Tom Keane | last post by:
Okay, this is probably real simple stuff for you guys. I know its simple, I used to know some of this stuff when I was learning Visual Basic in school, but yeah. Only a couple of things. ...
5
by: Michael | last post by:
In the past I have developed many micro-controller products using assembler. I have recently started using C, and so far I love it! I am very motivated to learn and become accustomed to the...
5
by: Fra-it | last post by:
Hi everybody, I'm trying to make the following code running properly, but I can't get rid of the "SEGMENTATION FAULT" error message when executing. Reading some messages posted earlier, I...
10
by: NotYetaNurd | last post by:
try { SqlDataReader dread=sqlcom.ExecuteReader(); } finally { dread.Close(); sqlcom.Connection.Close(); }
6
by: sstallman | last post by:
I have been tasked with creating a database in Access for a Mortgage Lending office. My boss wants a database that can be placed on the office server. He wants all of the lending officers to be...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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...

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.