469,623 Members | 1,438 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

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 7622
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by PayPal | last post: by
reply views Thread by ike2010 | last post: by
1 post views Thread by Jeff Lynch | last post: by
2 posts views Thread by IdleBrain | last post: by
1 post views Thread by xiaoning.sunx | last post: by
reply views Thread by daokfella | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.