Alex Rivera | Logout

ASP.NET UserControl class library

Asked 2009-11-19T19:22:11.410
10

Is it possible to create class libraries that contain UserControls so I can reuse them? If so, how? Is the markup compiled with the .dll? Thanks for any help!

Edit
Report

1 Answer

0

It sounds like custom server controls are what you are looking for.

If your controls are a combination of other server controls (e.g. a textbox and a button for a date control), then you could look at CompositeDataBoundControl and CompositeControl - these are handy ways of working with this sort of thing.

Beware, however, that it is very easy to get confused by the way the page cycle/viewstate re-hydration works. I've lost quite a bit of time over this, due to subtle misunderstandings of how it should work.

http://aspnetresources.com/blog/composite_databound_control.aspx

answered 2009-11-27T16:35:49.970

Your Answer