By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,353 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,353 IT Pros & Developers. It's quick & easy.

Dynamically finding a page control and setting some properties

P: n/a
Hi all,

Basically, I want to write something like this to hide a page control:
CType(currentPage.FindControl("theControlName"), Label).Visible = False

But, I want the controlName , and the type of the control to come from
a DB (string values)

Shared Sub mySub(ByRef currentPage As System.Web.UI.Page)

'gets 2 string values from a DB
dim controlName as string = "theControlName" 'present in the
currentPage
dim controlTypeName as string ="Label"

' this is what I want to do:
'==> CType(currentPage.FindControl("theControlName"),
Label).Visible = False

End Sub

Please help me out here!

Thanks

Antoine

Nov 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.