Board index » Web Programming » getvalue from user control

getvalue from user control

Web Programming135
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"?


-
 

Re:getvalue from user control

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!

***************************





"wapsiii" wrote:



Quote
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"?



-

Re:getvalue from user control

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



"wapsiii" <wapsiii@otmail.com>wrote in message

Quote
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"?





-

Re:getvalue from user control



I'm using:



strLocalVar = CType(Me.pOf.FindControl("picker"),

ComponentArt.Web.UI.Calendar).SelectedDate







On Mon, 10 Oct 2005 09:40:29 -0700, "Trevor Benedict R"

<trevornews@yahoo.com>wrote:



Quote
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



"wapsiii" <wapsiii@otmail.com>wrote in message

news:go3lk1ht4tk3l671bgddf6cq8njj90699q@4ax.com...

>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"?



-