Panel control is quite enough ?

  • Thread starter Thread starter Raghu Raman
  • Start date Start date
R

Raghu Raman

Hi,

am a biginner in .net designing.Does the panel control is enough to act
as a container .Because if , i design my controls in textboxes rows&
cols , i heared that the aclignment won't change in run time across the
browsers.

is it true? if the panel provides guaruntee that it keeps the controls
alignment same in runtime across the browsers, i can very well use the
panel control instead of tables ,to make it easier to control in server
side.


Please give u r comments
Regards
a drop in the ocean.
 
ASP.net server controls allows adaptive rendering, which means the HTML
markup of a server control can vary from browser to browser. I did a simple
test of a Panel server control and looked at the HTML source of Internet
Explorer 6 and Firefox 1.0 (Mozilla).

If you are using the .NET Framework 1.1, a Panel server control will render
the contents of a Panel surrounded by a <div> element (for example, if you
have this:

<asp:Panel runat="server">
Test
</asp:Panel>

the HTML in IE will be:

<div>

Test

</div>

The extra whitespace shouldn't matter with your styling.) However, if that
same page is viewed in the newest Firefox, the .NET 1.1 Framework renders
this:

<table cellpadding="0" cellspacing="0" border="0" width="100%"><tr><td>

Test

</td></tr></table>

I found it very strange the developers of .NET would do this, but you have
to remember that .NET 1.x came out several years ago, before Firefox was
even thought of. Needless to say, anything you have inside the Panel server
control will remain intact. It's just what's surrounding it that changes
from browser to browser.

If you're curious, I also tried this with the latest 2.0 build of the .NET
framework. Both browsers rendered the <div> way.

Happy coding,
Johann MacDonagh
 
Hi Johann ,

Thx for that.U r article shows that , all the inner control alignment
will remain intact .So i can very well use asp panel instead of html
.table.

U 've also said that the <div> will also be included.yes it is.

But could u pls tell me how to get the scroll bars in the panel controls


Thanks a lot
A drop in the ocean.
Raghu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top