FireFox does not acknowledge style attribute on <INPUT> tag

K

Keith-Earl

Our target browser has always been IE, but we have some associates that want
to FireFox to access one of our applications. We are using standard
ASP.NET Web Controls, particularly the Calendar control. I am posting here
since this issue affects all Web Controls.

We added a text box to Calendar cell (a day). It renders nicely in IE
because we set the width property to 40 pixels. Here is the generated HTML:

<input name="txtDur" type="text" id="txtDur"
style="font-family:Tahoma;font-size:XX-Small;width:40px;" />

Note the style attribute is supported.

When we run the same page with FireFox it totally ignores the style tag. I
assume that is an IE only extension.

Here is the HTML that FireFox accepts:

<input name="txtDur" type="text" id="txtDur" />

I say accepts because it seems to have stripped out the style attribute.

We really would like to limit the width of the textbox within the date cell
of the Calendar control to 40 pixels in any browser. How do we best do that?

Many thanks,

Keith
 
K

Keith-Earl

I found this solution, but it is not viable for us since we do not own the
server and cannot tweak the machine.config file. It may help someone else.


<<<Because Firefox is considered a downstream browser in .NET without
tweaking the machine.config file, WebControls emit different HTML for them
as it makes the erroneous assumption that the browser cannot support CSS>>>
 
S

Steve Walker

Keith-Earl said:
I found this solution, but it is not viable for us since we do not own the
server and cannot tweak the machine.config file. It may help someone else.


<<<Because Firefox is considered a downstream browser in .NET without
tweaking the machine.config file, WebControls emit different HTML for them
as it makes the erroneous assumption that the browser cannot support CSS>>>

You can however tweak the web.config file, which will work locally for
your application.

http://slingfive.com/pages/code/browserCaps/
 
K

Keith-Earl

Thanks. I actually took the low tech fix and forced the browser to be
uplevel. This is the simplest technique since it is a private web app that
will only support later versions of IE, FireFox, and NetScape or any browser
that supports CSS.

On the Page_load event I run:

Me.ClientTarget = "uplevel"

and I am golden.

If my team is not running a browser that supports CSS then they will be
disappointed. This will not happen

Thanks again.

Keith
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top