Solved

Format login control button.

Posted on 2010-11-27
11
497 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 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