Solved

Format login control button.

Posted on 2010-11-27
11
496 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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
 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 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