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 June 8th, 2004, 11:07 AM
Registered User
 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default User Control Reference

I create a user control called MyControl (pagelet)
I added that user control (pagelet) to my web form.
My "MyControl" has a number of properties which are set and I want to access those properities from the page which contains the User Control.

How do I get a reference to the control so that I can obtain the properties from the pagelet(user control)?

Thank in advance for your assistance!!!

 
Old June 8th, 2004, 11:59 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I think what you are asking for is this:

Protected WithEvent MyControl1 As MyControl

Then in the code-behind you can access MyControl1.<property>
 
Old June 8th, 2004, 12:29 PM
Registered User
 
Join Date: Jun 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, I tried that, but when the code executes, the first attempt to use the object give me a "object not set to an instance" error.

I am using C#, so I did not specify "with events". My line looks like this...

protected PageHeader1 _PageCtrl;

But as I said, this does not get me the instance of the control which was added to the form.









Similar Threads
Thread Thread Starter Forum Replies Last Post
Wizard Control Reference Colonel Angus .NET Framework 2.0 0 April 28th, 2008 08:54 AM
How to reference a pic from app_themes to control chrizzz ASP.NET 2.0 Basics 0 July 18th, 2006 04:17 AM
how to reference user control in master page.. gbianchi ASP.NET 2.0 Basics 1 May 1st, 2006 09:26 AM
Add Windows User control in Web User Control agarwalvidhu C# 0 March 30th, 2006 01:17 AM
Reference UserID of logged in user radiohalo5 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 February 7th, 2006 06:23 PM





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