473,406 Members | 2,633 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,406 software developers and data experts.

Problem: "Does not exist in current context"

hey

asp.net 2.0 (C'#)

In the code behind file I have this method:
public String AddBR(Object param) {
String text = (String) param;
return text;
}

(( I know this method does nothing, but when I've fixed the compile error
then I will add more code to this method ))

Here I'm using this AddBR method to set the text property of a TextBox:
Text='<%# AddBR(eval(question)) %>'

ERROR:
When I build my website I get this error:
"The name 'eval' does not exist in the current context"

What am I doing wrong here?

Jeff
Aug 30 '06 #1
2 9880
I dont understand why you're using eval here. Since, question is a
variable you can directly pass it on as a parameter. It should work.

Let me know, if i understood the problem wrongly.

--
Vadivel Kumar
http://www.vadivelk.net
va**@online.vadivelk.net (remove "online.")

Jeff wrote:
hey

asp.net 2.0 (C'#)

In the code behind file I have this method:
public String AddBR(Object param) {
String text = (String) param;
return text;
}

(( I know this method does nothing, but when I've fixed the compile error
then I will add more code to this method ))

Here I'm using this AddBR method to set the text property of a TextBox:
Text='<%# AddBR(eval(question)) %>'

ERROR:
When I build my website I get this error:
"The name 'eval' does not exist in the current context"

What am I doing wrong here?

Jeff

Aug 30 '06 #2
Sorry I forgot 2 " (added " arround the question)
Text='<%# AddBR(eval("question")) %>'
I also tried this:
Text='<%# AddBR(Bind("question")) %>'
but result in this error: The name 'Bindl' does not exist in the current
context"

This code does not work, it just sends the string "question" to the AddBR
method
Text='<%# AddBR("question") %>'
(I thought this was using the AddBR method directly)

I have not solved this problem yet!

Any suggestions?

The "question" represent a column in the resultset. So I'm interested in
sending this value to the AddBR method. Lets say this "question" column has
the value "How do you do?".. Then I want this "How do you do?" to be sent
into the AddBR method.

the purpose of this AddBR method is that I want to replace linefeeds in the
string with <br/- text formating

"Vadivel Kumar" <va******@vadivelk.netwrote in message
news:eT**************@TK2MSFTNGP04.phx.gbl...
>I dont understand why you're using eval here. Since, question is a variable
you can directly pass it on as a parameter. It should work.

Let me know, if i understood the problem wrongly.

--
Vadivel Kumar
http://www.vadivelk.net
va**@online.vadivelk.net (remove "online.")

Jeff wrote:
>hey

asp.net 2.0 (C'#)

In the code behind file I have this method:
public String AddBR(Object param) {
String text = (String) param;
return text;
}

(( I know this method does nothing, but when I've fixed the compile error
then I will add more code to this method ))

Here I'm using this AddBR method to set the text property of a TextBox:
Text='<%# AddBR(eval(question)) %>'

ERROR:
When I build my website I get this error:
"The name 'eval' does not exist in the current context"

What am I doing wrong here?

Jeff

Aug 30 '06 #3

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

Similar topics

0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
10
by: Roy | last post by:
Judging from the sheer number of posts on this topic, I'm sensing this is a fairly common problem. Only problem is, I've tried just about every recommendation in all the posts I've found thus far...
10
by: steingold | last post by:
Hi all, I wrote an application that takes snapshots using the snapshot monitor API (db2gGetSnapshot and db2GetSnapshotSize), every now and then these methods fail and I get SQL1024N error (A...
51
by: Tony Sinclair | last post by:
I'm just learning C#. I'm writing a program (using Visual C# 2005 on WinXP) to combine several files into one (HKSplit is a popular freeware program that does this, but it requires all input and...
3
by: Michael | last post by:
Hi, I am getting a strange error. Last night when I left work this was working perfectly. This morning when I try to run this code in VS2005, it comes up with an error saying "The name 'UserName'...
3
by: John Nagle | last post by:
The Python "reference manual" says, for "del", "Rather that spelling it out in full details, here are some hints." That's not too helpful. In particular, when "del" is applied to a class object,...
1
by: avecreep | last post by:
Hi, i was trying to find a web application and i found one open source on the internet. i put the code folders on the root folder and when i tried to acces via web browser it all worked fine ( i...
3
by: moltendorf | last post by:
I copied the files from my "test" database on my old server (MySQL was not running) to my new server ("./mysql/data/test" folder), and after starting the server, SHOW TABLES; shows all of the tables...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.