Groups | Blog | Home
all groups > asp.net > march 2005 >

asp.net : Changing the style of the button portion of an HtmlInput control


Patrick Olurotimi Ige
3/3/2005 4:07:26 PM
Mark i do this trick by using Button like

with a style sheet:-

..buttonStyle { FONT-WEIGHT: bold; FONT-SIZE: 7pt; TEXT-TRANSFORM:
capitalize; COLOR: white; FONT-FAMILY: Verdana; BACKGROUND-COLOR:
#7da1e9 }

<asp:ButtonColumn Text="Hello" ButtonType="PushButton" />

And on ItemCreated i set the CSClass by :-

Dim myButton As Button = CType(e.Item.Cells(0).Controls(0), Button)
myButton.CssClass = "buttonStyle"

Hope it helps
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Mark Rae
3/3/2005 11:16:13 PM
Hi,

Is there any way to modify the style of the button portion of an HtmlInput
control? I have a CSS class which I use for all of the buttons to try to
make them a little less ugly than the standard grey but, if I apply this to
an HtmlInput control, all that does is change the background and foreground
colours in the textbox portion.

Similarly, if I modify the style attribute, that only applies to the textbox
portion too.

Is there any way to change the appearance of the button portion of an
HtmlInput control?

Any assistance gratefully received.

Best,

Mark Rae

Mark Rae
3/4/2005 9:42:17 AM
[quoted text, click to view]

Patrick,

Unless I'm much mistaken, this code is to change the style of a ButtonColumn
in a DataGrid...?

Tampa.NET Koder
3/7/2005 6:49:43 AM
Man, your question is throwing me in circles. You keep going back and
forth. The HTMLInputText does not have a button, its just a plain old
textbox. Are you referring tot he HTML File upload control?? I suggest
you post a url where you page is hosted or something.


[quoted text, click to view]

Mark Rae
3/7/2005 10:49:28 AM
Does anyone have any thoughts on this...?

[quoted text, click to view]

Tampa.NET Koder
3/7/2005 2:12:43 PM
For that control, I think the same style for the button and the textbox
would have to be the same. I don't think you can split the style between
the two by default. You can always inherit from controls and style them the
way you want, even though this is a pain in the a$$ sometimes.


[quoted text, click to view]

Mark Rae
3/7/2005 4:57:56 PM
[quoted text, click to view]

Sorry, I'm referring to HtmlInputFile... :-(


[quoted text, click to view]

Mark Rae
3/7/2005 7:39:44 PM
[quoted text, click to view]

No matter what I try, any styles I set are applied to the textbox portion
only - seems it's impossible to modify the style of the button portion.

pj
3/7/2005 8:37:55 PM
On Mon, 7 Mar 2005 19:39:44 -0000, "Mark Rae"
[quoted text, click to view]

Forget ASP.NET for a minute. Just create a simple HTML webform with a
file input control on it, and try to change the style on the button.
It's pretty much impossible to do it.

pj
--
Mark Rae
3/7/2005 8:56:41 PM
[quoted text, click to view]

Yes indeed - anybody know how...?

pj
3/7/2005 9:12:11 PM
On Mon, 7 Mar 2005 20:56:41 -0000, "Mark Rae"
[quoted text, click to view]

No, nobody does :-). I just put the "pretty much" in to CMA. I think
what you're trying to do is in fact impossible.

pj

--
Patrick Olurotimi Ige
3/8/2005 3:02:12 AM
Mark sorry i posted another style..
But u can also apply a similar style to input button.
<input type="button" style="PUT UR STYLE HERE"/>
Hope it helps
Patrick


*** Sent via Developersdex http://www.developersdex.com ***
Mark Rae
3/8/2005 11:55:42 AM
[quoted text, click to view]

How does this apply to an HtmlInputFile control...?

AddThis Social Bookmark Button