473,408 Members | 1,754 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,408 software developers and data experts.

asp:panel alignment problem

Hi,

I am trying to center an panel using the following:

<asp:Panel id="pnltest" HorizontalAlign="Center" BackColor="white"
Width="800" Runat="server">
<asp:Button id=btnTest Runat="server" Text="press"></asp:Button>
</asp:Panel>

When view in a browser the following happens

mozilla firefox V1.0.7 works IE Version 6 doesn't it leaves the panel Left
Aligned
Looking at the sources, they are different:
Mozilla use <table> to render the output

<table id="pnltest" align="Center" cellpadding="0" cellspacing="0"
border="0" bgcolor="White" width="800"><tr><td align="Center">

<input type="submit" name="btnTest" value="press" id="btnTest" />

</td></tr></table> IE uses <div> to render the output<div id="pnltest"
align="Center" style="background-color:White;width:800px;"> <input
type="submit" name="btnTest" value="press" id="btnTest" /></div>Does anyone
know what I am doing wrong.Cheersgwc
Feb 11 '06 #1
1 5347
You are not doing wrong anything. It is up to Microsoft. In asp.net 2.0
both (IE and Firefox) renders panel as div. For IE you can center this
panel via css.
Try this:

* html body #pnltest {
margin-left: auto;
margin-right: auto;
}

This shoul work, if it does not, please provide more html source code.

Milan

Feb 11 '06 #2

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

Similar topics

1
by: Harry | last post by:
Hi, Slight problem in asp.net. (c#) I have a asp:panel page set up, with two different panels both of which contain a form. On the second page the user presses submit and the form details are...
3
by: Harry | last post by:
Hi, Can anyone help. I have a asp.net page (c#), with two panels, both of which have asp:textboxes on. When I press the first button, the second panel shows fine. When I press the button in...
6
by: sklett | last post by:
I'm curious... asp:Panel renderes a <div> tag, right? And you can have text in a div tag.... so why not have a Text property for the asp:panel control??
2
by: Mark Rae | last post by:
Hi, Is there any way to use the asp:Panel Web control so that it is always created regardless of its Visible property? E.g. if I write the following: <asp:Panel ID=pnlEvent Runat=server...
1
by: Pietro | last post by:
The asp:Panel tag renders a DIV in IE and TABLE in Firefox, where can i configure it to render DIV in both. Thanks Pietro
0
by: mahaq | last post by:
Hi Guys, I like to know if there is any better solution to this issue. I am a front end developer using CSS and asp.net technologies I have a .net page and I am using an external CSS file....
2
by: Darren Carter | last post by:
Hi, I have mutliple asp:Panel controls on a single page, each with a default button defined (each default button resides within its respective asp:Panel). All validation controls and buttons...
2
by: Nathan Sokalski | last post by:
I have an HTML table in which I am using ASP:Panel controls to group together <tr>'s so that I can more easily show/hide them (by setting the ASP:Panel's Visible property). This works fine, but...
6
by: phpmel | last post by:
Hi Guys, I have an asp panel,an associated drag panel extender, a label and an OK button that serves as a message popup. i would like this pop up to show up in the centre of the browser window...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.