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

Discussion in 'ASP .Net' started by =?Utf-8?B?dmluZWV0YmF0dGE=?=, Nov 6, 2004.

  1. 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
    --
    MCAD
    Vineet Batta
     
    =?Utf-8?B?dmluZWV0YmF0dGE=?=, Nov 6, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?dmluZWV0YmF0dGE=?=

    Scott Allen Guest

    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?

    --
    Scott
    http://www.OdeToCode.com/blogs/scott/

    On Sat, 6 Nov 2004 15:31:04 -0800, "vineetbatta"
    <> wrote:

    >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
     
    Scott Allen, Nov 7, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?dmluZWV0YmF0dGE=?=

    Alex Guest

    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.

    --
    Alex Mueller

    "vineetbatta" <> wrote in message
    news:...
    > 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
    > --
    > MCAD
    > Vineet Batta
     
    Alex, Nov 7, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TN Bella
    Replies:
    1
    Views:
    1,555
    TN Bella
    Jul 1, 2004
  2. vineetbatta

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

    vineetbatta, Nov 6, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    151
    Scott Mitchell [MVP]
    Nov 7, 2004
  3. Arthur Dent

    Cant get user-entered values in GridView

    Arthur Dent, Mar 13, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    280
    Arthur Dent
    Mar 14, 2006
  4. vineetbatta

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

    vineetbatta, Nov 6, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    194
    Scott Mitchell [MVP]
    Nov 7, 2004
  5. Robert Oschler
    Replies:
    1
    Views:
    402
Loading...

Share This Page