473,405 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Dynamically Loading the User Control and Passing Parameters to it.

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
Nov 24 '05 #1
1 1653
HP
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

"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

Nov 24 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Tim T | last post by:
Hi, I have the need to use dynamically loaded user controls in a webform page. I have the controls loading dynamically, and that part works fine. this is the code used in a webform to dynamically...
1
by: Sundaresan | last post by:
I've a form where I load two user controls dynamically. User Control-1 has a no.of dropdowns and based on the selection I typically populate a datagrid in the user control-2, Also the I could...
1
by: Jill Graham | last post by:
Hi, I can use following syntax to add user controls directly to my pages : <XYZ:myControl parameter1="value1" parameter2="value2" runat="server" /> The control "myControl" is executed using...
1
by: Josh | last post by:
Hi Guys, I have been having a big problem with trying to pass parameters into a user control when the user control is dynamically loaded into a placholder. I am developing in c#. I have get...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
3
by: voro.cibus | last post by:
I have been reading up on this all day, and I can't find the answer (or more likely, don't understand the answers I have found) to my problem. I have a table that stores the name of my ascx page....
2
by: A.Wussow | last post by:
Hi Everybody, i want to load dynamically content from some user controls (with forms, or some data-controls) using atlas. So i use an UpdatePanel for loading the user control into a placeholder....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.