Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 December 1st, 2005, 01:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing arguments to contructor of dynamically...

... loaded UserControl. When loading UserControl dynamically the developer doesn't seem to have any possibility to pass arguments to the contructor, since it is automatically the default constructor, which is executed. Can this be true?

I have something like this...
Code:
myPage = (PageMain)this.Page.LoadControl("controls/ucMain.ascx");
... and would like to be able to force a contructor, which allows arguments. Currently, I am calling an initialization method after the construction, but would like to do it in the contruction. Is it possible?

Thanks,
Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old December 1st, 2005, 03:24 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

LoadControl has only one possible constructor.

 
Old December 1st, 2005, 04:21 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, then I have to settle for the initialize method, and do the null checks. Thanks for you help.

Jacob.
 
Old December 2nd, 2005, 02:43 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

No problem.. Glad to help

Jim






Similar Threads
Thread Thread Starter Forum Replies Last Post
Declarative arguments passing between DetailsViews andremi Classic ASP Basics 1 May 10th, 2007 09:24 PM
Passing multiple arguments to function zarikiane XSLT 2 July 18th, 2006 09:35 AM
passing arguments to executables DaveG BOOK: Professional SQL Server 2005 Integration Services ISBN: 0-7645-8435-9 0 May 30th, 2006 03:26 PM
Problem passing multiple arguments to php script method PHP How-To 0 February 8th, 2006 09:03 AM
passing/getting arguments from ShellExecute TazMania23 Visual C++ 0 May 21st, 2004 12:14 PM





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