Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > want to add an image to a html type input button

Reply
Thread Tools

want to add an image to a html type input button

 
 
Valli
Guest
Posts: n/a
 
      09-26-2007
Hi,

I want to add an image to a html type input button. How can I do this?
I have used background image style . But its not working.

My target is to show an image in the button
can anyone help me?

--
Regards
Valli


 
Reply With Quote
 
 
 
 
Chris Fulstow
Guest
Posts: n/a
 
      09-26-2007
On Sep 26, 6:18 pm, "Valli" <erva...@chellasoft.com> wrote:
> Hi,
>
> I want to add an image to a html type input button. How can I do this?
> I have used background image style . But its not working.
>
> My target is to show an image in the button
> can anyone help me?
>
> --
> Regards
> Valli


Hi Valli

You're on the right track, you also need to set the background color
to transparent:
background-color: transparent;

Or you can do it all in one go:
background: transparent url(ButtonImage.gif) no-repeat center top;

Chris

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      09-26-2007
On Sep 26, 10:18 am, "Valli" <erva...@chellasoft.com> wrote:
> Hi,
>
> I want to add an image to a html type input button. How can I do this?
> I have used background image style . But its not working.
>
> My target is to show an image in the button
> can anyone help me?
>
> --
> Regards
> Valli


<input type="button" value="Button"
style="background-image: url('http://msdn2.microsoft.com/msdn/controls/
toolbar/en-us/StarWhite.gif');">

 
Reply With Quote
 
Valli
Guest
Posts: n/a
 
      09-26-2007
Hi,

Thanks for your help. Using background color style, the image is getting
displayed in button now.
I am using this button in a html table cell. When user clicks on this
button, i will get the rowindex of the selected row.
If I use this style, the rowindex is not resulting properly.

Do you have any ideas on this?

--
Regards
Valli

"Chris Fulstow" <> wrote in message
news: ps.com...
> On Sep 26, 6:18 pm, "Valli" <erva...@chellasoft.com> wrote:
>> Hi,
>>
>> I want to add an image to a html type input button. How can I do this?
>> I have used background image style . But its not working.
>>
>> My target is to show an image in the button
>> can anyone help me?
>>
>> --
>> Regards
>> Valli

>
> Hi Valli
>
> You're on the right track, you also need to set the background color
> to transparent:
> background-color: transparent;
>
> Or you can do it all in one go:
> background: transparent url(ButtonImage.gif) no-repeat center top;
>
> Chris
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
asp button always rendered as type="button" vs. type="submit" Sam ASP .Net Web Controls 1 11-25-2008 06:14 PM
HTTP::Request::Form - Can't submit a form with input type=image button fochie Perl Misc 0 02-01-2005 06:42 AM
Coloring input type=input browse button; uploading multiple files Ron Brennan Javascript 5 05-14-2004 08:13 PM
HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type Roberto ASP General 3 10-18-2003 06:56 AM
Can i have an image button doing the functionality of file input of html Mathew George ASP .Net Datagrid Control 0 09-15-2003 05:37 AM



Advertisments