Are Webcontrols for doing this?

Discussion in 'ASP .Net Web Controls' started by Karl, Mar 2, 2005.

  1. Karl

    Karl Guest

    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.
     
    Karl, Mar 2, 2005
    #1
    1. Advertising

  2. Karl

    MasterGaurav Guest

    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
    --------------------------------
     
    MasterGaurav, Mar 2, 2005
    #2
    1. Advertising

  3. Karl

    Karl Guest

    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?


    >>>"text-align: right".


    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.




    "MasterGaurav" <> wrote in message
    news:...
    > 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
    > --------------------------------
    >
     
    Karl, Mar 2, 2005
    #3
  4. 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.

    "Karl" <> wrote in message
    news:...
    > 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?
    >
    >
    > >>>"text-align: right".

    >
    > 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.
    >
    >
    >
    >
    > "MasterGaurav" <> wrote in message
    > news:...
    > > 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
    > > --------------------------------
    > >

    >
    >
     
    David Alexander, Mar 2, 2005
    #4
  5. Karl

    MasterGaurav Guest

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


    Yes. You can add OnMouseOver and OnMouseOut client-side event-handlers,
    like:

    onmouseout="this.src='/images/raised.gif';"
    onmouseover="this.src='/images/sunk.gif';"

    --
    Cheers,
    Gaurav Vaish
    http://mastergaurav.org
    http://mastergaurav.blogspot.com
    ------------------------------------
     
    MasterGaurav, Mar 3, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Leif

    WebControls Button

    Leif, Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    864
  2. Rhys Gravell

    Re: WebControls Button

    Rhys Gravell, Jun 25, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    876
    Rhys Gravell
    Jun 25, 2003
  3. John Smith

    Clearing values in WebControls

    John Smith, Jun 28, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    449
    John Smith
    Jun 29, 2003
  4. Jurjen de Groot

    IE Webcontrols, different images for TreeView

    Jurjen de Groot, Jul 8, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    351
    Yan-Hong Huang[MSFT]
    Jul 9, 2003
  5. =?Utf-8?B?RHJCeXRlcw==?=

    Webcontrols forgets values and is doing my head in

    =?Utf-8?B?RHJCeXRlcw==?=, Mar 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    298
    =?Utf-8?B?RHJCeXRlcw==?=
    Mar 13, 2006
Loading...

Share This Page