User Controls Versus DLLs

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
 
L

Lucas Tam

(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.
 
R

Robert Koritnik

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.
 
G

Gopal Krish

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.
 

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

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top