Evaluating a string expression / command

Viaboom
01-30-2007, 12:29 PM
Sorry if this is a repost, I am not sure what it is called to look it up. Simply what I am trying to do that I have done in other languages through eval is build a string and execute it. Rough example:

Dim sTmp As String

sTmp = Form1. & "Textbox1" & .Text

Msgbox(sTmp)


I know the example is ugly and in actual use "Textbox1" would be a variable.

Cheers!

wayneph
01-31-2007, 07:22 AM
1. MsgBox doesn't work in ASP.NET. (The code runs on the server. I'm pretty sure you don't want to click a button on the server each time a user runs the code...)

2. Use FindControl() to get controls.
Label1.Text = DirectCast(Me.FindControl("TextBox1"), TextBox).Text

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum