?
Solved

ASP.net buttons

Posted on 2014-04-14
2
Medium Priority
?
289 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
jayakrishnabh earned 2000 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:Murray Brown
ID: 39998780
Thanks very much
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

771 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