Solved

ASP.net buttons

Posted on 2014-04-14
2
280 Views
Last Modified: 2014-04-14
Hi
  What is the difference between the following two buttons and how can I set the BackColor to "White" and the BorderStyle to "None" for the first button?

   

   <button id="button10" class="myHoverButton">Submit</button>
           
  <asp:Button ID="Button1" CSSClass="myHoverButton" runat="server"
            Text="Who needs aesthetic dentistry" BackColor="White" BorderStyle="None"
            Font-Names="Century Gothic" ForeColor="Maroon" Font-Bold=False Width="231px" />
0
Comment
Question by:murbro
2 Comments
 
LVL 5

Accepted Solution

by:
jayakrishnabh earned 500 total points
ID: 39998702
both are server control buttons that cause the page postback on its click. since first button doesnot have runat="server" attribute, it cannot be accessed in page behind file (aspx.cs).

To set any style to only first button (id = button10), create styles with its id and dont apply class to it.

<button id="button10">Submit</button>

<style>
.myHoverButton {
            background-color: red !important;
        }
        .myHoverButton:hover {
            background-color: #9999ff !important;            
        }
        #button10 {
            background-color: white !important;
            border-style: none;
        }
</style>
0
 

Author Closing Comment

by:murbro
ID: 39998780
Thanks very much
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question