Is there any difference in overhead between using Panel
or HtmlContainerControl
when needing to create a serverside container in ASP.NET.
HtmlContainerControl Container = new HtmlGenericControl("div");
Or
Panel Container = new Panel();
Also, are there any differences in how it is rendered in different browsers? I've noticed that Panel seems to render as a div in all browsers I have used.
Panel supports extra functionality such as Direction, BackImageUrl, ScrollBars, etc... However if all you need is a div, I would use HtmlGenericControl.
It is explicit which makes for better code readability. It also gives you more control over the markup, e.g. you may not agree with how something like BackImageUrl has been implemented by Microsoft.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With