VS2005 UserControls

R

Robert Mago

Hi,

I have been using web usercontrols on 2003 for a very long time and i find
them userful for modularity. Usually what i do is create a subfolder called
'UserControls' for example and placed the web usercontrols there ( i would
change the namespace to *.UserControls.[control name] ).

However, when i tried this in VS2005, i couldn't get an instance of the
control when i did this.loadcontrol(control path) as X. Investigating
further i found that is no longer possible in VS2005 to get an instance of
the control that way.

So my question is, how do i achieve the same modularity in VS2005 for new
controls? Also, if i have existing solutions with the user controls already
developed and tested, is there a way to make a wrapper around them and use
them also?

Thanks,
 
G

Guest

You need to make an interface for the control in the AppCode folder and make
the control implement it. Then you can cast the reference from LoadControl to
the interface.
I imagine this might be why they included the extract interface refactoring
in VS2005.

Ciaran O'Donnell
 

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

Top