Figer's Technology Consulting | Creating a JQuery CSS imageless button and calling it from .NET code behind

Creating a JQuery CSS imageless button and calling it from .NET code behind

Add this style to the page 
 ---------------------------------
<style>
.myButton {
-moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
-webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
background-color:#ededed;
-moz-border-radius:6px;
-webkit-border-radius:6px;
border-radius:6px;
border:1px solid #dcdcdc;
display:inline-block;
color:#777777;
font-family:arial;
font-size:15px;
font-weight:bold;
padding:6px 24px;
text-decoration:none;
text-shadow:1px 1px 0px #ffffff;
}.myButton:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
background-color:#dfdfdf;
}.myButton:active {
position:relative;
top:1px;
}
</style>

--------------------------------- 
  Add this as your button to the page 
 --------------------------------- 
 <a href="#" id="testbutton" runat="server" title="Test Button" class="myButton">test button</a> 

 --------------------------------- 
  Add this as your event handler to the code behind (using vb.net in this example) 
 --------------------------------- 
 Private Sub CmdTestButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles testbutton.ServerClick 

Dim i As String = "" 
'This is just test code to add a break to and confirm it gets caught here when you attach the debugger 
End Sub
Comments are closed