Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2005, 04:42 AM
Authorized User
 
Join Date: Nov 2004
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in user control

Dear all
i'm facing a problem with the user controls
i would like to ask if anybody could help me in knowing how to handle the
values of a user control from outside the control.
e.g.
i have a drop down list, this drop down list is a user control and it is
filled according to a qurey built in the user control.
i want to use this drop down list on different page of my application with
the same values and data, but on each time i have several buttons that would
use the values selected in the drop down list in a different way.
i want to know how could i get the value of this control and if i can't can
i create a class with an interface (HTML) that could do for me this job?

Thank you all for your help.



Georges M. Kaddoum
__________________
<GMK>
 
Old March 2nd, 2005, 09:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Follow this post.
http://p2p.wrox.com/topic.asp?TOPIC_ID=15969

I used Event Bubbling.

 
Old March 4th, 2005, 04:17 PM
Registered User
 
Join Date: Mar 2005
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try exposing the values u want to be exposed from the user control as Public properties. As follows

Public Class TestUserControl

‘. . . . . Other code

    Public Property ComboValue() As String
        Get
            Return “SomeValue”
        End Get
        Set(ByVal Value As String)
            DdlCombo.selectedvalue= Value
        End Set
    End Property
End Class

In your ASPX page after dropping the usercontrol, Instantiate the control and access the property value as follows.

Dim objCTL As New TestUserControl
TextBox2.Text = objCTL. ComboValue


Regards
Jay






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem while using User Control vivekshah ASP.NET 1.0 and 1.1 Professional 0 August 7th, 2008 02:46 AM
Much much problem with the User Control! daffodils ASP.NET 1.0 and 1.1 Basics 7 October 20th, 2006 10:46 AM
Dynamic user control problem sandeep General .NET 0 September 26th, 2005 09:42 AM
User Control Problem alyeng2000 ASP.NET 1.0 and 1.1 Basics 4 March 19th, 2004 11:22 PM
Web User Control Problem shmacgregor VS.NET 2002/2003 18 February 22nd, 2004 06:29 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.