Solved

Format login control button.

Posted on 2010-11-27
11
490 Views
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?
0
Comment
Question by:Blowfelt82
11 Comments
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Try using the CssClass attribute.
<asp:Button id="btnLogin" runat="server" CssClass="button"></asp:Button>

Open in new window

0
 

Author Comment

by:Blowfelt82
Comment Utility
The CSS class I use is for an anchor element not a button element so I dont think this would work.
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Have you tried? Styles work for all controls.
It depends on how you style it.
0
 

Author Comment

by:Blowfelt82
Comment Utility
Just tried it, but didnt work... I dont think the CSS properties I use can be applied to buttons
0
 
LVL 33

Expert Comment

by:hongjun
Comment Utility
Use <asp:LinkButton...>  instead.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:Blowfelt82
Comment Utility
Ok, but how would I get the LinkButton to submit a login form?
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 166 total points
Comment Utility
0
 
LVL 33

Assisted Solution

by:hongjun
hongjun earned 166 total points
Comment Utility
By default, the LinkButton will do a postback.
See this for an example
http://www.asp101.com/samples/login_aspx
0
 
LVL 2

Accepted Solution

by:
Aazmodeus earned 168 total points
Comment Utility
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:
.login-submit
{background-color:__your_background_color__; border:0; color:__your_link_color__; __all_the_other_stuff_you_need__}
0
 
LVL 29

Expert Comment

by:Kumaraswamy R
Comment Utility
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

6 Experts available now in Live!

Get 1:1 Help Now