Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
How will we use an image as a button asp.net
please help me i am in a big confusion help me
Posted 1-Jan-13 22:24pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is trivial. There's an imagebutton control in ASP.NET. All it does is put an anchor tag around an img tag.
 
In general, as well as reading books on HTML and ASP.NET ( two different things ), you can work out how to do stuff on web pages by finding a page that does what you want and viewing the source code. Chrome makes this easy.
  Permalink  
v2
Comments
magiccoder at 2-Jan-13 4:52am
   
Hey,
otherwise add firebug.This will work great with firefox.
magiccoder at 2-Jan-13 4:53am
   
Hey Christian Graus,
 
+5 for you...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi,
 
Christian Graus is correct.
 
Try to add ImageButton control instead of normal button.
 
Anyways,If you want to use normal button ,then write some css
 

this is just an example.change the values as you wish.
 

 
.button{
	border:none;
	cursor: pointer;
	background-image: url(../images/btnbg.gif);
	background-repeat: repeat-x;
	background-position: left top;
	width: 81px;
	padding:5px;
	color: #FFF;
}
 

 

 
Happy Coding....
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Hi,
 
a) Use Image button
or
b) Set Css of a buton.
 
.button
{
border:none;
cursor: pointer;
background-image: url('/img/img.png');
background-repeat: no-repeat;
}
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 353
1 OriginalGriff 304
2 George Jonsson 258
3 Shemeemsha RA 138
4 Animesh Datta 130
0 OriginalGriff 5,985
1 Sergey Alexandrovich Kryukov 5,341
2 CPallini 4,760
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 2 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100