Passing Data To and From User Control

Discussion in 'ASP .Net' started by Hermit Dave, Sep 22, 2004.

  1. Hermit Dave

    Hermit Dave Guest

    have a look at this article... it did the job when i needed to do something similar
    http://www.dotnetjunkies.com/Article/E1F97CE9-7834-46FA-BED9-866F720AB013..dcik

    --

    Regards,

    Hermit Dave
    (http://hdave.blogspot.com)
    "http://www.visual-basic-data-mining.net/forum" <> wrote in message news:...
    I have a aspx page say Parent.aspx which contains a user control Child.ascx .

    I would like to pass the value of a dropdown in my parent.aspx to Child.aspx for some calculation and get back the calculated value to the parent page.

    How do I do that?

    --
    thepooh - forum member
    http://www.visual-basic-data-mining.net/forum
     
    Hermit Dave, Sep 22, 2004
    #1
    1. Advertising

  2. Hermit Dave

    Joan Guest

    And here is a little recursive re-entrant function in VB, that will help
    when you don't know how deep you need to go to find the control you need.

    Public Shared Function LocateControl(ByVal pParentControl As Control, ByVal
    psID As String) As Control

    Dim controlloop As Control
    Dim controlfound As Control
    Dim bFound As Boolean
    For Each controlloop In pParentControl.Controls
    If Not controlloop.ID Is Nothing Then
    If controlloop.ID.ToUpper = psID.ToUpper Then
    Return controlloop
    End If
    End If
    If controlloop.Controls.Count > 0 Then
    controlfound = LocateControl(controlloop, psID)
    If Not controlfound Is Nothing Then
    Return controlfound
    End If
    End If
    Next
    Return Nothing
    End Function


    "http://www.visual-basic-data-mining.net/forum" <> wrote
    in message news:...
    I have a aspx page say Parent.aspx which contains a user control Child.ascx
    ..

    I would like to pass the value of a dropdown in my parent.aspx to Child.aspx
    for some calculation and get back the calculated value to the parent page.

    How do I do that?

    --
    thepooh - forum member
    http://www.visual-basic-data-mining.net/forum
     
    Joan, Sep 22, 2004
    #2
    1. Advertising

  3. I have a aspx page say Parent.aspx which contains a user control Child.ascx .

    I would like to pass the value of a dropdown in my parent.aspx to Child.aspx for some calculation and get back the calculated value to the parent page.

    How do I do that?

    --
    thepooh - forum member
    http://www.visual-basic-data-mining.net/forum
     
    http://www.visual-basic-data-mining.net/forum, Sep 22, 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. panche
    Replies:
    1
    Views:
    532
    Peter Blum
    Jul 21, 2005
  2. Mad Scientist Jr
    Replies:
    0
    Views:
    659
    Mad Scientist Jr
    Mar 22, 2006
  3. paul
    Replies:
    1
    Views:
    697
    Neutrino
    Apr 17, 2006
  4. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    568
    Jonathan Wood
    Feb 2, 2010
  5. hmikki
    Replies:
    1
    Views:
    150
    Nathan Sokalski
    Oct 19, 2007
Loading...

Share This Page