[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Format login control button.

Posted on 2010-11-27
Medium Priority
Last Modified: 2012-05-10
I have the following code to make a button...

<a class="button" href="#" onclick="this.blur();"><span>Login</span></a>

The CSS on this element styles my button how I would like it (but note that I am not using an ASP.NET/HTML button control). I have used this styling throughout my website. I have placed a login control onto my page but the styling of the 'Login' button is useless and I would like to make this in line with the rest of the buttons on my site. How can I adapt the line above to submit the login control?
Question by:Blowfelt82
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
LVL 33

Expert Comment

ID: 34221701
Try using the CssClass attribute.
<asp:Button id="btnLogin" runat="server" CssClass="button"></asp:Button>

Open in new window


Author Comment

ID: 34222233
The CSS class I use is for an anchor element not a button element so I dont think this would work.
LVL 33

Expert Comment

ID: 34222249
Have you tried? Styles work for all controls.
It depends on how you style it.
Technology Partners: 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!


Author Comment

ID: 34222257
Just tried it, but didnt work... I dont think the CSS properties I use can be applied to buttons
LVL 33

Expert Comment

ID: 34222284
Use <asp:LinkButton...>  instead.

Author Comment

ID: 34222341
Ok, but how would I get the LinkButton to submit a login form?
LVL 83

Assisted Solution

CodeCruiser earned 664 total points
ID: 34222895
LVL 33

Assisted Solution

hongjun earned 664 total points
ID: 34223583
By default, the LinkButton will do a postback.
See this for an example

Accepted Solution

Aazmodeus earned 672 total points
ID: 34225012
If you want to use <a> tag to submit form, you should consider using javascript. E.g. if you use jquery do it like this <a href="#" onclick="$(form_selector).submit(); return false;">Login</a>.
But I don't understand why you can't change the look of you submit button, so that it will be just like a link. Create some css-style and assign it to your submit button:
{background-color:__your_background_color__; border:0; color:__your_link_color__; __all_the_other_stuff_you_need__}
LVL 29

Expert Comment

by:Kumaraswamy R
ID: 34421779
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
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.…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

650 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