How to access values entered in User control in the main page.

G

Guest

Hi all,

i have a user control which allows the user to enter Name& Address in text
boxes.

I use the same user control in the main page...

Is there a simple way of accessing the Name & address entered in the text
boxes of the user control in the main page(Page hosting the user control
using Resgister directive.).

Any pointers will be helpful.

regards
Vineet Batta
 
S

Scott Allen

You could expose Name and Address as public properties of the user
control class (that get the values from the text boxes). Then add a
field to the page class of the user control type and refer to those
properties when you need them. Make sense?
 
A

Alex

I noticed your MCAD signature, so I will assume you've already tried to get
the user input from the textboxes by something like this... tbxMyName.Text
on the back end. Assuming this control of your's in an ascx module, have you
tried to call something like this in your code-behind...
this.FindControl("tbxMyName")? It looks like you have a user control with a
Name and address textbox, that you have loaded twice on the page, is that
right? If this is true, when your control is posted back, can you tell what
instance it was? Is there a button causing the post back? If you can provide
a little more information it might be easier to understand your situation.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top