Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Firefox Compatibility with dynamically added labels?

Reply
Thread Tools

Firefox Compatibility with dynamically added labels?

 
 
=?Utf-8?B?Qko=?=
Guest
Posts: n/a
 
      05-20-2005
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.
 
Reply With Quote
 
 
 
 
MasterGaurav
Guest
Posts: n/a
 
      05-20-2005
Is it possible to have a screenshot? You may upload the screenshot
somewhere (like Flickr or photoblog).


Cheers,
Gaurav Vaish
http://mastergaurav.org
http://mastergaurav.blogspot.com
------------------------

 
Reply With Quote
 
 
 
 
Michel de Becdelièvre
Guest
Posts: n/a
 
      05-20-2005
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.



 
Reply With Quote
 
MasterGaurav
Guest
Posts: n/a
 
      05-26-2005
Firefox, I think, is always recognized as UpLevel.

Netscape 4.x and downwards are DownLevel browsers.

--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
-------------------

 
Reply With Quote
 
Michel de Becdelièvre
Guest
Posts: n/a
 
      05-27-2005
False.

To have firefox recognized (in 1.1), you need to change your config files.
(Not that this is very usefull because of the liberal use of document.all[]
in ASP.Net JavaScript files).

"MasterGaurav" <> a écrit dans le message de news:
. com...
> Firefox, I think, is always recognized as UpLevel.
>
> Netscape 4.x and downwards are DownLevel browsers.
>
> --
> Cheers,
> Gaurav Vaish
> http://mastergaurav.blogspot.com
> http://mastergaurav.org
> -------------------
>



 
Reply With Quote
 
MasterGaurav
Guest
Posts: n/a
 
      06-14-2005
Ummm....

Let me check. May be I got it wrong.

--
Cheers,
Gaurav Vaish
http://mastergaurav.blogspot.com
http://mastergaurav.org
---------------------

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Solution for posterity: GridView, Datakeys, and "Item has already been added. Key in dictionary: 'CategoryID' Key being added: 'CategoryID'" ASP .Net 2 11-02-2006 04:48 AM
Inserting Controls Dynamically - with Validators Also Added Dynamically Jeffrey Todd ASP .Net 1 06-02-2005 04:33 PM
how come user control added to page doesn't get added to codebehind file? Bennett Haselton ASP .Net 1 11-08-2004 09:26 PM
newbie: Dynamically added controls are lost after postback NotYetaNurd ASP .Net 1 11-07-2003 01:31 PM
Positioning Dynamically added controls Harry ASP .Net 1 06-25-2003 06:08 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57