473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

User Controls Versus DLLs

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
Nov 18 '05 #1
5 1601
ge*****@yahoo.com (Gopal Krish) wrote in news:8b4092e6.0410041628.1add2854
@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.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #2
User controls are easy to create.

Conversly, Custom controls are easier to use and to reuse.

Here's more info:
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ercontrols.asp
http://msdn.microsoft.com/library/de...ebControls.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
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

Nov 18 '05 #3
Thanks much...That's a nice starting point for me.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #4
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.

--
RobertK
{ Clever? No just smart. }

"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
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

Nov 18 '05 #5
Thanks much..

"Robert Koritnik" <ro************************@avtenta.si> wrote in message news:<OQ**************@TK2MSFTNGP15.phx.gbl>...
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.

--
RobertK
{ Clever? No just smart. }

"Gopal Krish" <ge*****@yahoo.com> wrote in message
news:8b**************************@posting.google.c om...
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

Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Gibson | last post by:
Hi, Was wondering if anybody could point me in the right direction. I'm looking at developing a Windows User Control using Visual Studio .NET 2005 in C#. The user control is to be used on a web...
2
by: news.microsoft.com | last post by:
I am unable to load the user control from client machine browser if the user controls referes other custom dlls that I have created. Its working fine if I access the user control from my machine...
1
by: Laszlo Szijarto | last post by:
Could someone please give me a link to somewhere which explains how to package web control (ActiveX) .dlls? I created an ActiveX-type .dll user control. Now this user control has within it...
5
by: Drew | last post by:
I have a user control written in C#. This user control uses some of my mixed mode C++ libraries. My user control is currently residing on a .NET Windows Form. Everything works nicely. Now I am...
6
by: Earl Teigrob | last post by:
I am writing an application that dynamically loads user controls at run time based on user options. I would like to give my users the ability to build their own user controls and add them to my...
2
by: Brandon Potter | last post by:
Why is it that when I override the OnInit method for a page, I can add a user control like this: Me.Controls.Add(LoadControl("MyControl.ascx")) (where MyControl.ascx is your every day user...
4
by: dx | last post by:
I have 3 vb.net web applications. I would like all 3 to have access to a library of user controls. server controls wouldn't cause a problem but these are user controls (ascx.) From each solution...
4
by: Eric | last post by:
I got a particular problem in visual studio 2005 There's a user control on page and I want to meka a cast like this MyPage mp=(MyPage)this.Page; Error is : cannot cast from...
8
by: | last post by:
I'm looking for some design guidance on a collection of projects I'm working on. The project involves a bunch of websites constructed out of a collection of user controls. Different user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.