473,385 Members | 1,908 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to center Login control on a page?

dan
Hi,

Could someone please let me know how to center a Login control on a page?

Can I use CSS to do that?

Thanks,
Dan
Jun 27 '08 #1
6 8028
ADN
Hi dan,

You could use the CssClass property of the login control to style your
login control and position it:

<asp:Login runat="server" id="myLogin" CssClass="myClass"></asp:Login>

Additionally, you could also wrap your LoginControl in a div and then
position your div on the page wherever you'd like it using a css class

<div class="myClass"><asp:Login runat="server" id="myLogin"></
asp:Login></div>

Jun 27 '08 #2
Or you could use this;

<center>
Login controls
</center>

it works for me
"dan" <da*@company.comwrote in message
news:OU**************@TK2MSFTNGP02.phx.gbl...
Hi,

Could someone please let me know how to center a Login control on a page?

Can I use CSS to do that?

Thanks,
Dan


Jun 27 '08 #3
"Rob Eventine" <bt****@ntlworld.comwrote in message
news:xY*****************@newsfe6-gui.ntli.net...

[top-posting corrected]
>Could someone please let me know how to center a Login control on a page?

Can I use CSS to do that?

Or you could use this;

<center>
Login controls
</center>
The <centertag has been deprecated for ages and should not be used...
it works for me
On what browser(s) / platform(s) have you tested it...?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #4
dan
Thanks for the reply.

I'm still strugling with it. The css applied to the login control seems to
re-arrange controls within the login but does not actually center the
'whole' login control. Would you able to provide a simple example?

Thanks,
Dan

"ADN" <vc******@gmail.comwrote in message
news:96**********************************@26g2000h sk.googlegroups.com...
Hi dan,

You could use the CssClass property of the login control to style your
login control and position it:

<asp:Login runat="server" id="myLogin" CssClass="myClass"></asp:Login>

Additionally, you could also wrap your LoginControl in a div and then
position your div on the page wherever you'd like it using a css class

<div class="myClass"><asp:Login runat="server" id="myLogin"></
asp:Login></div>

Jun 27 '08 #5
ADN
Hey Dan,

If your css class moves all of the controls around, then you could try
the second approach of wrapping the login control in a div like so:

<style>
..myClass{ margin-right: 25%; }
</style>

<div class="myClass"><asp:Login runat="server" id="myLogin"></
asp:Login></div>

I agree with Mark, you shouldn't be using a <centertag at all. It's
bad practice and it probably isn't browser compatible with all
browsers.
Jun 27 '08 #6
<div style="width:200px; margin-left:auto; margin-right:auto">
<your login control />
</div>

"dan" <da*@company.coma écrit dans le message de news:
OU**************@TK2MSFTNGP02.phx.gbl...
Hi,

Could someone please let me know how to center a Login control on a page?

Can I use CSS to do that?

Thanks,
Dan


Jun 27 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: PayPal | last post by:
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft DHTML Editing Control"> <TITLE></TITLE> </HEAD> <BODY> <STYLE type=text/css> ..dummy {} BODY, TD {font-family:...
0
by: ike2010 | last post by:
I have a Login control and it has one ImageButton ("Login"). How do I center the actual button on the control? It is right-aligned with the Login Title.
1
by: Jeff Lynch | last post by:
I'd like to add the following attributes to the Login control's Login Button to create a CSS rollover effect. How can I access the control's login button from the page's code-behind? ...
3
by: ilockett | last post by:
The background: I have a web app with a simple master page that contains just one content placeholder. I have created a web form that then uses this master page. Within the content...
2
by: IdleBrain | last post by:
Hello All: I used a Login control to authenticate a user to login. The problem is that when I login with good username & password, the login view would say that the login was successful. But...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
1
by: xiaoning.sunx | last post by:
Hi all, I had installed DB2 V9 Express-C on my server Ubuntu 6.10 and it runs well. Now, I would like to open DB2 Control Center from my windows (I use ssh and putty to connect with server ).In...
1
by: jobs | last post by:
I have a simple login page with roughly a 300px x 300px image behind the asp.net login control. I need the login control to land in the middle of the image. I want both the image and the login...
0
by: daokfella | last post by:
I have a Login.aspx page that takes care of all my login procedures (validation, lockouts, password change requirements, password retrieval, etc.) It works like a charm. However, now I'd like a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.