Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 September 13th, 2004, 02:40 PM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple user controls on a page

I'm not sure how to ask this question, but basically what I have is multiple user controls on a page that all interact with each other. What is the sequence of events that occurs when instantiating controls on a page (i.e., when can the page get access to custom properties on a control) and how do I get the controls to 'see' each other? Right now, I'm declaring the control as protected with the other controls, but when I step through the code, they come back as Nothing. Do I need to pull the info I need in a different page event?

 
Old September 13th, 2004, 08:46 PM
Registered User
 
Join Date: Sep 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

first,what you said is bad code function.
we should not write code like this because it is not oo method.
any way , we can use this code.

this.Page.findcontrol("control1")

 
Old September 14th, 2004, 08:42 AM
Registered User
 
Join Date: Sep 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I might not have been clear in what I was asking... Say for example that one of the user controls on the page sets and stores values that are needed either on the page itself, or in another control. If you try to retrieve those values during the Page_Load of the page, the control is set to Nothing, so I can't get anything from it until, say, the PreRender event.

If I have one control setting/storing values, and another using those values to perform an action, should they both bet placed in a 3rd user control that is then placed on the page, and the PreRender event used there for the code logic?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing controls in host page from User Control Axe BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 1 March 16th, 2011 06:22 AM
User controls' content: Chapter 2 User Controls AGS BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 10 July 26th, 2007 05:36 AM
how can i access controls on parent page from user marvz ASP.NET 2.0 Basics 0 September 5th, 2005 11:18 PM
User controls not showing on web page pdr ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2005 09:02 AM
Multiple ADO multiple user login Oracle9i jhay0721 Pro VB Databases 1 April 4th, 2005 11:23 AM





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