Hi,
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 object 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,
Andy
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 object 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,
Andy

Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Aug 19, 2010, 3:01 AM EDT
Write like
"Label3.Text ="+'"+ Label1.Text +"'+'"+Label1.Text+"'
With Regards,
Gomathi.P
Andrew FensterRank #983 · 2K reputationPosted Aug 19, 2010, 5:15 PM EDT
Andy Sujoto8 reputationPosted Aug 19, 2010, 7:53 PM EDT
Can you be more specific? i still don't get what do you try to tell me. put in a little bit full code will be more helpful. Thanks.
Hi Andrew,
I try to issue the command within the page_load event or any click event, also this is just an example, since i still have to load a lot of properties to be set on fly. Is it possible to set it on events ? please enlighten me. thanks.
Andrew FensterRank #983 · 2K reputationPosted Aug 20, 2010, 10:00 AM EDT
protected void Page_Load(object sender, EventArgs e)
{
Label3.Text = Label1.Text + " " + Label2.Text;
}
Or this:
protected void Button1_Click(object sender, EventArgs e)
{
Label3.Text = Label1.Text + " " + Label2.Text;
}
Andy Sujoto8 reputationPosted Aug 22, 2010, 7:24 PM EDT
In your example, is not dynamic. This is what i try to achieve.
I have a program (aspx) that will receive a parameter, based on the parameter, this program will get all required data from
Thanks,
Andy