User Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a user control which contains buttons. I can load it from an ascx
file into my current webpage:

me.FindControl(0)

How do I refer to it's buttons?
 
Hi,

if the user control has code-behind file, you can cast the returned general
UC instance into the code-behind type and access those controls via UC's
members (having properties).

Another way is running another FindControl against the UC instance and
locating child controls that way. E.g chainign FindControl calls.

E.g

CType(Me.FindControl("UC").FindControl("btnSend"),Button)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top