User Controls Versus DLLs

  • Thread starter Thread starter Gopal Krish
  • Start date Start date
G

Gopal Krish

Wondering what's the pros and cons in creating reusable web controls
using

1. User Controls
2. C# class that creates the controls programmatically

Example,

I want to develop a page menu (Reset, Back, Submit etc) that I can
reuse in all my screens. Reset and Back are Hyperlinks and Submit is
Link Button (which should fire a Click even when clicked).

My question is..should I develop a reusable user control or should I
write a C# /VB.NET class to create the controls programmatically?

Thanks for any thoughts.

-- Gopal
 
(e-mail address removed) (Gopal Krish) wrote in @posting.google.com:
1. User Controls
2. C# class that creates the controls programmatically

Example,

I want to develop a page menu (Reset, Back, Submit etc) that I can
reuse in all my screens. Reset and Back are Hyperlinks and Submit is
Link Button (which should fire a Click even when clicked).

My question is..should I develop a reusable user control or should I
write a C# /VB.NET class to create the controls programmatically?

You can design the interface graphically with user controls.

With user controls, you can't instantiate them like a normal class, rather
you need to use the LoadControl method. Besides this minor point, I would
use User Controls for design intensive controls. Otherwise I would use a
class.

BTW, you can always mix and match the two... use a user control for the
interface and a class for the logic.
 
In your case it would be MUCH MUCH easier to write User Controls, while it's
single application dependant and it's not as reusable as Web Custom Controls
should be.

I suggest you to use User Controls in this particular case.
 
Thanks much..

Robert Koritnik said:
In your case it would be MUCH MUCH easier to write User Controls, while it's
single application dependant and it's not as reusable as Web Custom Controls
should be.

I suggest you to use User Controls in this particular case.
 
Back
Top