View Full Version : asp label width doesn't work in firefox
bigbird8891
07-03-2008, 12:05 AM
I had a post about this in the html forum until I realized it was an asp problem.
The problem is that it doesn't render the width of labels and buttons in firefox:
<asp:button runat="server" id="btnNew" width="80px" text="New" CssClass="clsButton" CausesValidation="False" />
Why is that?
I am using .net 1.1
thanks for the help
-Will
vinyl-junkie
07-03-2008, 02:49 AM
Make the width part of your clsButton css class. That will work in both FF and IE.
bigbird8891
07-03-2008, 05:37 AM
Unfortunately the width isn't uniform throughout the whole site and the site has many pages, and it isn't just buttons the labels are also not the right width,
Here is an example:
http://img329.imageshack.us/img329/5354/ievffrb1.th.gif
through some research I found that it might be a problem in the machine.config or web.config file. could that be part of the problem?
Thanks
-Will
vinyl-junkie
07-03-2008, 06:07 AM
Sorry, the image you posted is too small for me to read. :(
The problem that you described in your original post doesn't have anything to do with the machine.config or web.config files. The solution I gave you works in both FF and IE for your button. It will also work for any other control you want to style.
From what you say, it sounds like there are a lot of embedded styles in your ASP.NET code, not just the example you mentioned. If that's the case, I know it's a lot of work to do but you'll be better off in the long run modifying your code to take advantage of the CssClass attribute and putting your styles in your stylesheet. That will help with uniformity of appearance, plus it will be much easier to change the look and feel of your site in the future.
bigbird8891
07-03-2008, 03:03 PM
Here is a link to the larger image:
http://img329.imageshack.us/img329/5354/ievffrb1.th.gif (http://img329.imageshack.us/my.php?image=ievffrb1.gif)
I came across this forum about the matter saying that it is a problem with the config files:
http://bytes.com/forum/thread339353.html
Is that first reply not correct?
I know i'm lazy and looking for the easy way out, but there are a ton of pages I would have to change.:D
thanks again
-Will
vinyl-junkie
07-04-2008, 04:24 AM
From the date on that forum post and the blog it links to, that is probably a very old solution that might not work for you. It's also most likely .NET 1.1, which could affect your pages depending on what version of .NET your site is written in.
I never heard of a solution like that. However, I would say that if their solution works for you, use it. If not, you'll have to bite the bullet and make the changes I suggested.
Something else to keep in mind, too, is that browsers change and the quick and dirty solution that works today might not work when a newer browser comes along.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.