Solved

Format login control button.

Posted on 2010-11-27
11
495 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
ID: 34221701
Try using the CssClass attribute.
<asp:Button id="btnLogin" runat="server" CssClass="button"></asp:Button>

Open in new window

0
 

Author Comment

by:Blowfelt82
ID: 34222233
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
ID: 34222249
Have you tried? Styles work for all controls.
It depends on how you style it.
0
 

Author Comment

by:Blowfelt82
ID: 34222257
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
ID: 34222284
Use <asp:LinkButton...>  instead.
0
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.

 

Author Comment

by:Blowfelt82
ID: 34222341
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
ID: 34222895
0
 
LVL 33

Assisted Solution

by:hongjun
hongjun earned 166 total points
ID: 34223583
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
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:
.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
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.
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
How to remove double quotes from a string in VB.Net 5 38
Error in JQuery 5 37
Advice on Xojo as a development tool over VB. 4 35
Advice in Xamarin 21 52
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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

912 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

19 Experts available now in Live!

Get 1:1 Help Now