473,809 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textbox Width Issue (Rendered differently for different browsers)

Using ASP.NET 1.1

I have an <asp:TextBox. .. for which I set the width property --- "width=30".

The textbox is being rendered to the browser like this:

<input name="someName" type="text" maxlength="3" id="someID"
style="width:30 px;" />

Notice the [Width=30] gets rendered as [style="width:30 px;"]. This causes
the textbox to be 30 pixels wide, at least in IE and Opera.

I have discovered in testing that the [style="width:30 px;"] part is *omitted
completely* from the rendered HTML when the page is requested by FireFox or
Netscape Navigator (6.2) - so the textbox (really <input... />) gets some
default width rather than being set to 30 pixels wide.

What can I do to set the width the same for FireFox and NN (same as for IE)?

Thanks!
Dec 17 '05 #1
2 4825

Dont use inline styles. Rather use the cssclass property and set it to a
class defined in your stylesheet. The problem w/ the inline styles is that
asp.net see gecko browser as downlevel and as such doesnt send the inline
style info. And i would have thought that it woulndt send it to opera either
since it considers only ie as uplevel.
"Jeff" <Je**@NoSpam.co m> wrote in message
news:OX******** ******@TK2MSFTN GP14.phx.gbl...

Using ASP.NET 1.1

I have an <asp:TextBox. .. for which I set the width property ---
"width=30".

The textbox is being rendered to the browser like this:

<input name="someName" type="text" maxlength="3" id="someID"
style="width:30 px;" />

Notice the [Width=30] gets rendered as [style="width:30 px;"]. This causes
the textbox to be 30 pixels wide, at least in IE and Opera.

I have discovered in testing that the [style="width:30 px;"] part is
*omitted completely* from the rendered HTML when the page is requested by
FireFox or Netscape Navigator (6.2) - so the textbox (really <input... />)
gets some default width rather than being set to 30 pixels wide.

What can I do to set the width the same for FireFox and NN (same as for
IE)?

Thanks!


Dec 17 '05 #2
Take a look at the following URL for an Browsercap update too add to your
web.config or machine.config file.
http://slingfive.com/pages/code/browserCaps/

That should take care of that problem with asp.net considering most browsers
as downlevel.

Regards
Dec 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
12232
by: Graham J | last post by:
Apologies for the partial post that mysteriously escaped as I was composing. I shall try again. For many years I have been happily and successfully coding tables such that the WIDTH specified in a TD is the complete column width including any CELLPADDING. For example for a 400 pixel wide table with four 100 pixel wide columns and 10 pixel cellpadding... <TABLE WIDTH="400" BORDER="0" CELLSPACING="0" CELLPADDING="10">
5
2833
by: Andrew | last post by:
Could someone please tell me why this simple table test is completely mangled by Netscape? HTML: <TABLE WIDTH="90%" ALIGN="center" BORDER="0" CELLPADDING="0" CELLSPACING="1" BGCOLOR="Black"> <TR> <TD WIDTH="100" HEIGHT="20" ALIGN="center" BGCOLOR="#eeeeee" NOWRAP>Left Cell</B></TD> <TD WIDTH="100%" HEIGHT="20" ALIGN="center"
5
35086
by: Chris Stromberger | last post by:
I have a div with a width of 40em (is em cool to use for width?). The situation below applies even if width is auto or 80% or something. Inside the div I am displaying some code with <pre> tags. If the code has a very long line (wider than the div), then what's supposed to happen? IE and Mozilla do two very different things. IE expands the div to encompass the line (creating horizontal scrollbars in the browser window if nec). Mozilla...
15
10542
by: Peter Pfannenschmid | last post by:
Dear all, my question is concerning the following html page: http://www.omeganet.de/test/test.shtml Could anybody tell me why the text input box (the fourth element) is wider than the other elements if the page is displayed in IE6 and latest Mozilla? If displayed in Opera, the input box is as wide as the other elements - as it should be.
8
3529
by: tshad | last post by:
I cannot seem to get the asp:textbox to use classes. Style works fine. I am trying to set the textbox to act like a label in some instance so it doesn't have a border, readonly and the background is grey. I have a class set as: ..table2Label{ border-style:none; background-color:#F6F6F6; }
1
1542
by: craigkenisston | last post by:
I'm creating a form with asp.net. I have my inputs like this : <label for="USER_COMPANY">Company Name:</label> <asp:textbox id="USER_COMPANY" runat="server" cssclass="inputBox" style="width:250px"></asp:textbox><br > This worked great until I used the designer and it took ride of the "style=width:250px" and changed them without my approval for "width:250px".
14
3138
by: Haines Brown | last post by:
I know I'm missing something obvious. I need a short horizontal rule to preceed a line of text (in a bibliography in which the author is repeated). I tried this: <p> <div class="rule"></div>, Title of book ... </p> style:
1
2820
by: =?Utf-8?B?d2NsYXJrZTEwMQ==?= | last post by:
Hello all, I've created the following ASP.NET code sample which, when rendered, displays a 100% textbox within a single cell table. The problem is that Internet Explorer (6 or 7) truncates the right-hand edge of the textbox. The textbox renders correctly on Firefox and Netscape. <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="Content_test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
1
1529
by: Jeff | last post by:
hi asp.net 2.0 Below is some markup I have trouble with. The problem is that the Textbox doesn't fill the entire DataCell. I've set width of TextBox to 100%.... The point is that I want the * to be aligned exactly at the right corner of the TextBox. As it is now there is a huge space between them, maybe 30px
0
9602
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10639
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10120
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.