first possibility : is firefox identified as an uplevel browser in your
setup ?
if not, you need to change this
(by overriding in web.config :
<browserCaps>
<file src="Web.browserCaps.xml" />
</browserCaps>
) with a suitable Web.browserCaps.xml, a number of them are available on the
web, do a search.
otherwise all Controls (except explicit HtmlControls) will output HTML3.2
junk.
second possibility :
IE is dead wrong in its HTML W3C conformity. This is fairly common.
A good way to avoid being trapped in this kind of situation is to use
HtmlControls rather than Controls unless they have some *real* added value
(such as Repeater, DataGrid, HierarGrid, etc.). This way you "think" HTML
first, IE second.
"BJ" <> a écrit dans le message de news:
B4397FBD-CC26-4E74-AE68-...
> Hi,
>
> I add label and text box fields dynamically in code using C# and ASP.NET.
> I
> set the width of the label using:
>
> Label label = new Label();
> label.Width = 20;
> label.Text = "Test";
> panel.Controls.Add(label);
>
> This works fine with IE where the width is correct, but the widths of the
> labels are not working using Mozilla Firefox. On further investigation it
> seems that firefox is having problems with the <span> tag that is used on
> the
> aspx page.
>
> Has anyone come across this or know or a work around.