using a usercontrol from code behind

J

John Koswalski

I have a test usercontrol,

It works fine from the HTML page of the webform. If i want to manipulate
the control (properties, methods) I can get that to work if add in
dynamically at run time. Adding it to the webform at design time (drag and
drop) doesn't allow me access to the properties and methods from the code
behind. I added the declaration to the control without the new keyword and
I even tried to direct cast the control using the FindControl function to
the variable but it doesn't work ... any ideas .....

Thx
 
W

William

John Koswalski said:
I have a test usercontrol,

It works fine from the HTML page of the webform. If i want to manipulate
the control (properties, methods) I can get that to work if add in
dynamically at run time. Adding it to the webform at design time (drag and
drop) doesn't allow me access to the properties and methods from the code
behind. I added the declaration to the control without the new keyword and
I even tried to direct cast the control using the FindControl function to
the variable but it doesn't work ... any ideas .....

Thx


When you declare the control in your codebehind page it has to have
the same name as the ID of the user control in the aspx page.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,266
Messages
2,571,078
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top