solving consistent look problem

J

JJ

Using asp.net 1.1

I am trying to have a consistent look for the webcontrols. Right now, every
time I use textbox controls, I manually change the font property, size
property, and other property to the default values that I use for all
webcontrols. So a lot of manual work. To streamline the process, I see two
possibilities.

1. Would it be better to do this by extending a textbox control by creating
my own control (ie creating a web control project for each controls that I
use, be it label, dropdown textbox etc)
2. Use the CssClass property of each webcontrol to control.

Problem with the creating my own control is that to create the dll, I have
to create web control project for each control (to have this new control in
the toolbox of IDE). I thought I just need to create the new class that
extends the textbox class but I guess that is not possible (without creating
a new project)?

Problem with the using CssClass is that I also have to manually add link tag
for every single page and setting value for CssClass.

How do you go about solving this problem? What is the best way? Any
recommendation and advice will be appreciated.
Thanks
 
C

Cowboy \(Gregory A. Beamer\)

You are partially correct on #1. You will have to create a library to
contain the control to get it on the toolbox. This is still a great option,
as you can reuse acros multiple projects.

#2 is also a good option, but you will have to set the CSS for each control,
or create a snippet with the control attached to CSS and reuse it.
 
A

apathetic

JJ said:
1. Would it be better to do this by extending a textbox control by creating
my own control (ie creating a web control project for each controls that I
use, be it label, dropdown textbox etc)
2. Use the CssClass property of each webcontrol to control.

It would be best to use CSS, as this is exactly what it's made for.

You don't even need to use CssClass to get a little bit of styling. For
example, if it's only text box font you want to control, you can create
a style definition such as the following that will be picket up by every
input box:

input, textarea
{
font: 11px Arial;
}

apathetic
 

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,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top