getvalue from user control

  • Thread starter Thread starter wapsiii
  • Start date Start date
W

wapsiii

I have placed a input box on a user control and add the user control
several times to my aspx pages.

How do I retrieve the value of the individual implementations of the
user control?

Whould I use reflection (and how) ? or reference the id of the
rendered input box directly i.e. "pOf_P_picker", "pOr_P_picker"?
 
If you just slap the control on the page numerous times, you can use the
declared name of the control on your page. By default:

nameOfControl1
nameOfControl2
nameOfControl3

If you are programatically adding the user control, it is the name you
assigned to the control, provided you don't repaint over the control before
pulling values from it.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 
The Texbox within the UserControl is defined as Protected. Hence you would
have to expose it through a public Property which returns the Text Property
of the textbox Control or you could change the declaration of the Textbox
within the UserControl to be Public. I would rather go for the 1st method.

HTH

Trevor Benedict R
MCSD
 
I'm using:

strLocalVar = CType(Me.pOf.FindControl("picker"),
ComponentArt.Web.UI.Calendar).SelectedDate
 

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