Solved

ASP.net buttons

Posted on 2014-04-14
2
277 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now