|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Dynamically Loading the User Control and Passing Parameters to it.I am loading the user control daynamically using Page.LoadControl('mycontrol.ascx"). But with this i can not get my datamember's properties. For example i declare a private integer variable then i write a property to get or set the value of that private integer variable. But with the above method i can'nt get that property. the second way is to create the object of mycontrol class and then add it in the page.controls collection. but with this it did not show the controls of user control like textboxes and buttons. Reply me soon please.... Regards, Muhammad Jamil Nawaz Hi Jamil,
The Page.LoadControl() method returns the control object. So if you wish to access some of the properties of your control you can do the follwing, Dim m as MyControl m = CType(Page.LoadControl("MyControl.ascx"), MyControl) m.Property1 ... Hope that helps. Regards, HP Show quoteHide quote "Jamil" wrote: > Hello, > > I am loading the user control daynamically using > Page.LoadControl('mycontrol.ascx"). > But with this i can not get my datamember's properties. > For example i declare a private integer variable > then i write a property to get or set the value of that private integer > variable. > But with the above method i can'nt get that property. > > the second way is to create the object of mycontrol class and then add it in > the page.controls collection. > but with this it did not show the controls of user control like textboxes > and buttons. > > Reply me soon please.... > > Regards, > Muhammad Jamil Nawaz > > >
Other interesting topics
HTTPModule/HTTPHandler to process request
must use updateable query request specific holding location.... hitting enter button while in textbox calls correct button's click event GredView {0:d} formatting doesn't work How do I show a sectioned list? OO Help Asp DropDownList Horizontal CSS drop-down menu? Fail to save xmldocument |
|||||||||||||||||||||||