Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / July 2006

Tip: Looking for answers? Try searching our database.

LoadControl(Type t, object[] parameters) usage

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ASPboy - 13 Jul 2006 09:56 GMT
has anybody used this type of loading user controls,

in the user control how will i hadle the passed parameters in the contructor
and also

can somebody give a code script for instantiating the object[] parameters

thanks.
Alessandro Zifiglio - 13 Jul 2006 12:55 GMT
for eg. if the constructor for the control you want to load looks like this

public myUserControl (string s, bool b, int i){// constructor code here}

// as you can see there are 3 arguments for the constructor.
// One thing to be careful about is that you need to pass the arguments in
the same order they are
// listed in your constructor, and the type of the objects in your object
array should match,
// so as in the following code.

object[] myParameters = {"test", true, 3};

myUserControl c1 = LoadControl(myUserControl, myParameters);

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

> has anybody used this type of loading user controls,
>
[quoted text clipped - 5 lines]
>
> thanks.
Alessandro Zifiglio - 13 Jul 2006 12:59 GMT
Also, dont forget to check the relevent documentation. Its pretty clear in
what you need to do :

http://msdn2.microsoft.com/en-us/library/ewtd66a0.aspx

Regards,
Alessandro Zifiglio
http://www.AsyncUI.net

> for eg. if the constructor for the control you want to load looks like
> this :
[quoted text clipped - 25 lines]
>>
>> thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.