Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Passing Data To and From User Control

Reply
Thread Tools

Passing Data To and From User Control

 
 
Hermit Dave
Guest
Posts: n/a
 
      09-22-2004
have a look at this article... it did the job when i needed to do something similar
http://www.dotnetjunkies.com/Article...720AB013..dcik

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"http://www.visual-basic-data-mining.net/forum" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
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


 
Reply With Quote
 
 
 
 
Joan
Guest
Posts: n/a
 
      09-22-2004
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" <(E-Mail Removed)> wrote
in message news:(E-Mail Removed)...
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

 
Reply With Quote
 
 
 
 
http://www.visual-basic-data-mining.net/forum
Guest
Posts: n/a
 
      09-22-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
Passing Parameters to user control within another user control hmikki ASP .Net Web Controls 1 10-19-2007 02:00 AM
Passing data to user control in a view paul ASP .Net 1 04-17-2006 04:30 AM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Validating Data on User Control and Passing Back to the Page panche ASP .Net 1 07-21-2005 04:58 PM



Advertisments