Solved

ASP.net buttons

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to go to Web page 2 98
ASP.net VB.net Object not set to an instance of an object 4 33
LINQ - C# to VB convertion 12 48
ADO.NET ENTITY DATA MODEL 3 31
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

920 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

16 Experts available now in Live!

Get 1:1 Help Now