Instantiate UserControl without LoadControl

  • Thread starter Matteo Migliore
  • Start date
M

Matteo Migliore

Hi.

This is a question about ASP.NET 2.0.

How can I instantiate a UserControl without
the method LoadControl?

I need to create a usercontrol from
a .ascx file that is out of the web application,
it's placed into a virtual directory.

Thanks!

Matteo Migliore.
 
G

Guest

In the ASP.NET model, user controls are the down and dirty way to get
repetitive functionality without complete black boxing your code. It is a
compromise between flexibility and full encapsulation. Because of the
compromise, you are stuck in a tigher box than you are with compiled code.

I can think of a possible kludge and fix for this issue:

The kludge is to aim at the source file and reflect emit in your
application. Have not tried with a user control, but it "should" work with
some tweaking.

The fix is to move your code to a library as a server control. This will
take more time.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top