Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 December 21st, 2003, 07:05 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default how to get control by its String name

i need to deal with some controls by their name as string like:
instead of calling like textbox1.text i can call it as
controls("textbox1").text ???

Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old December 21st, 2003, 11:46 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Usually you would use:

    parentControl.FindControl("myControlStringName")
 
Old December 22nd, 2003, 11:10 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

thx Peter,
i was fully stuck

i also modify it like follows to deal more free with the control like

Ctype(parentControl.FindControl("myControlStringNa me"),textbox)

Any comment.


Ahmed Ali
Software Developer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert "String" type to "Control" type ? kishore_peddi C# 4 January 11th, 2006 01:21 PM
syntax to find a string in a string cole SQL Server 2000 2 October 10th, 2005 06:06 PM
Replace string with a control shenku ASP.NET 1.0 and 1.1 Professional 3 August 22nd, 2005 09:20 AM
how to replace a string with another string/number crmpicco Javascript How-To 4 March 14th, 2005 12:59 PM





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