Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
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 August 21st, 2005, 08:38 AM
Authorized User
 
Join Date: Mar 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mistry_bhavin
Default Passing Values To User Control

Hello to every one.
I am working with asp.net 1.1

I have created som web User controls in my project, and i want to
load that controls dynamically as they are required. So I use
LoadControl method to load them.

My problem is that in some controls there are public properties
that i have created and to be set at time of loading.
But from the base form i am not able to set that property
can any one help me out with this ?
thank U....

 
Old August 21st, 2005, 08:46 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If the properties of your control are marked as Private, you should be able to set the properties right after you created an instance of it with LoadControl:
Code:
Dim myControl As MyUserControl = CType(LoadControl bla bla), MyUserControl)
' Control is ready, now set its properties:
myControl.SomeProperty = SomeValue
Page.Controls.Add(myControl)
Does this help?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Bazaar by The Tea Party (Track 2 from the album: The Edges Of Twilight) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a DataSource to a user control hpox ASP.NET 2.0 Professional 1 January 8th, 2007 11:04 AM
passing parameters to user control jbeynon ASP.NET 2.0 Professional 0 August 30th, 2006 06:18 AM
Dynamic user control- not able to set values ghari ASP.NET 1.0 and 1.1 Professional 0 January 4th, 2006 01:16 AM
Passing as object as a Param to a Web User Control MixedCode General .NET 2 December 8th, 2004 11:36 AM
Passing a Value to a User Control DC Ross ASP.NET 1.0 and 1.1 Basics 2 February 17th, 2004 06:38 PM





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