Results 1 to 3 of 3

Thread: Convert string to textbox

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2002
    Posts
    80

    Convert string to textbox

    How do I convert a string to a textbox object?

    Ex.

    dim strTest as string

    strTest="textbox" & 1

    'I want to convert strTest to a textbox object

    Thanks,

    James

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    I think what you are looking for is findcontrol

    Dim myString as String = "TextBox" & 2
    Dim myControl1 As Control = FindControl(myString)
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3

    Thread Starter
    Registered User
    Join Date
    Jul 2002
    Posts
    80
    Lord_Rat,

    Thanks, your code is what I'm looking for. I've used the FindControl function in the past but since I'm still new to asp.net I forgot about it. Thanks for the reminder.

    James

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width