Are Webcontrols for doing this?

K

Karl

Before I spend a lot of time researching how to design webcontrols, I want
to know if what I want to do is what webcontrols are designed to doing.

Will webcontrols allow me to design a clickable button in the shape of a
stop sign in such a way that any modern browser when loading the web page
will be able to render it?

Will webcontrols allow me to design an editbox (textbox) that maintains the
insertion point at the right edge of the box and right justifies the text?
(Naturally so that any modern browser renders it.)

If the answer to either is yes, can someone point me to an article or two
(or book) that I should read?

TIA.
 
M

MasterGaurav

Yes. You will need to write some DHTML code for your page.

Clickable button as stop-sign: Why not use an <input type="image">
control?

TextBox: You can use a simple style attribute with a value "text-align:
right".

Is there anything more that you need?

Books: Read for styles (and CSS) associated with each HTML element. Try
w3school.org (basic) or w3.org (for nerds)

--
Cheers,
Gaurav Vaish
http://www.mastergaurav.org
http://mastergaurav.blogspot.com
--------------------------------
 
K

Karl

Thanks for the reply.

re: <input type="image">

But if the user clicks on an image, the image does not depress like a
button, does it?


For some reason, I had thought that had been deprecated. In any event, I
don't believe that setting the text-align property will force the insertion
point to the right as well. I'll have to check that. Additionally, I want to
have a control that will automatically insert thousand separators as the
user enters numbers. (like the style of an electronic calculator).

It sounds to me as if a custom ASP.NET webcontrol (or is this called a
server control?) is the way to go.
 
D

David Alexander

The standard ASP.NET Button has an Image property, so if you want a button
to look like a stop sign, you can just assign a stop sign JPG or GIF to this
property. The only possible reason to write your own control is because you
want the button to be octagonal, rather than a square button containing an
octagonal image.

The standard textbox will also allow you to justify text with its TextAlign
property. Keeping the cursor at the right edge of the typed-in text is the
default behavior.

ASP.NET controls are processed by the web server and passed to the client as
HTML, so any modern browser can display them. The only caveat is that
ASP.NET uses JavaScript and many contemporary browsers allow users to turn
JavaScript off, in which case all web app functionality will be drastically
reduced. A web client viewing the page would only realize that it was an
ASP.NET page because of the .aspx suffix at the end of the URL.

If you really need an irregularly shaped control (octagonal stopsign) you
will need to write a web control. If you search the web or browse in a book
store, you should be able to find many examples, as it is a favorite topic.
I would search online for existing examples that you can alter. Round
buttons are more common, I found an example at
http://www.codeproject.com/cs/miscctrl/RoundButton_csharp.asp. Another
option is to look for third-party vendors that offer controls that you could
buy.

Hope this helps.
 

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,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top