all groups > asp.net > january 2004 >
You're in the

asp.net

group:

how convert contents of string variable to label id



how convert contents of string variable to label id tony collier
1/11/2004 11:16:32 PM
asp.net: Hi all

I have the following in my html page:

<asp:Label id="name1" runat="server"/>


and this code in my <script> section

string var="name1";
var.Text="whatever";


this won't work as is because it is seen as trying to execute the method
Text on string var. Is it possible to extract the value of var and apply
Re: how convert contents of string variable to label id Dan Brussee
1/11/2004 11:59:13 PM
On Sun, 11 Jan 2004 23:16:32 GMT, tony collier <melakka@hotmail.com>
[quoted text, click to view]


Try this...

string var = name1.Text;

name1.Text = "whatever";
AddThis Social Bookmark Button