Wrox Programmer Forums
C# 2008 aka C# 3.0 Discuss the Visual C# 2008 (aka C# 3.0) language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2008 aka C# 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 22nd, 2010, 11:40 PM
Registered User
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default EVAL()


I have a program (aspx) that will receive a parameter, based on the parameter, this program will get all required data from server. within the data, it contains a lot of object (that should be created) along with it properties (that should be set). for creating object on fly, i found no issue, however, when came to setting its properties, i don't know how to make it works.

I have tried using CodeDomProvider to compile the code on fly and get the value returned, like :
string sEval = "1+1", will always return 2.

However when i try to use the same concept on objects like example below, i got an error :

I have a webform with 3 textbox on it, named Label1, Label2, Label3.

Label1.Text = "my first name"
Label2.Text = " my family name"

string sEval = "Label3.Text = Label1.Text + Label2.Text"
now i want to run sEval that will fill Label3.Text = "my first name, my family name".

how to achieve that? please help.

Thanks in advance,
Old April 6th, 2011, 07:44 AM
Authorized User
Join Date: Dec 2004
Posts: 69
Thanks: 0
Thanked 5 Times in 5 Posts
Send a message via Yahoo to whiterainbow

So the concatenation of string. Try this

string sEval = "Label3.Text = " + Label1.Text + ", " + Label2.Text
Thanks in advance.


Senthil Kumar M.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace xsl:eval dhrumil XSLT 5 April 8th, 2010 09:11 AM
Name "Eval" is not declared. thuyvncr BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 December 21st, 2006 03:48 AM
Eval??? tsimsha Classic ASP Basics 2 January 17th, 2005 10:02 PM
Databinder.Eval jpfree71 ASP.NET 1.0 and 1.1 Basics 2 August 26th, 2004 11:07 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.