Changing the style of the button portion of an HtmlInput control

M

Mark Rae

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
 
P

Patrick Olurotimi Ige

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
 
M

Mark Rae

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"

Patrick,

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

Tampa.NET Koder

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.
 
T

Tampa.NET Koder

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.
 
M

Mark Rae

For that control, I think the same style for the button and the textbox
would have to be the same.

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.
 
P

pj

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.

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
 
M

Mark Rae

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.

Yes indeed - anybody know how...?
 
P

Patrick Olurotimi Ige

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
 
M

Mark Rae

But u can also apply a similar style to input button.
<input type="button" style="PUT UR STYLE HERE"/>
Hope it helps

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

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top