Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0how to add a WebUserControl in class library:how to add a WebUserControl in class library:
Previous
 
Next
New Post
5/28/2008 2:32 AM
 

hi,

This is my question:   How to add a WebUserControl.ascx control in Class library?

actually, i finished one Module, i need to convert a DLL , In Class Library (C#)  webusercontrols s  not available .

so, pls tell some idea.

Kind regards..

soona

thank u

 
New Post
5/30/2008 2:17 PM
 

As far as I know this can't be done, at least not all the way.  The only way to include an ASP.NET control in a class library is to convert your User Control to a Server Control which is a lot work (but usualy possible), especially if you are also learning Server Control development at the same time.  DNN has several server controls that they use, see the WebControls project code and the code for the User Properties controls in the Controls\PropertyEditor\Edit Controls foler of the Library project for some good examples.

The most you can do is move your code behind into a class library which is the approach that DNN takes for a lot of stuff.  The code behind for all the controls in the "controls" folder of the web site (labelcontrol.ascx, urlcontrol.ascx, etc) is in the Library project in the "controls" folder (along with a lot of other stuff as well).  The Library project assembly ends up in the web site's bin folder via the build process so when ASP.NET goes looking for the code behind class it finds it in that class library.  In other ASP.NET projects you can also do some tricks with pre-compiling the web site where you end up with all the ASCX "code" in an assembly but DNN does not support pre-compiling so those options are not available.

 
New Post
5/30/2008 2:50 PM
 

I'm not sure I understand what you're asking, can you provide some more information about your module and "why" you think you need to add a web control in a class library? A class library is purely code it is not a control.  Maybe it's just a problem with your english .. do you want your class library to "create" a web control, then you module would be able to call the class library to create the control and then have the control injected into your module?

Anyway, it's not really clear what it is you are trying to accomplish.  If you can somehow explain it a little more, maybe we can help you or maybe we can suggest an alternate approach to solving your problem.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0how to add a WebUserControl in class library:how to add a WebUserControl in class library:


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out