473,398 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

textbox control styles not added for Mozilla

Hi,
Is there a way to force .NET to add styles to controls to display
properties as set in the VS.NET designer? I'm using Visual Studio.NET
2002, and therefore 1.0 .NET framework.

For example, I've created a page that has a textbox control with its
width set in the VS.NET designer. When the page is displayed in IE6 it
has the style added to the input field to display it how I wanted:

<input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
id="LeftMenu_txtMiniAge" style="width:34px;" />

However when I view the same page in the latest Mozilla the styles
aren't added and I get:

<input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
id="LeftMenu_txtMiniAge" />

In fact I'm not getting styles added to any controls in Mozilla unless I
explicitly set them in the code behind file, eg:

txtMiniAge.Style.Add("width", "34px")

Its much easier to set the properties in the designer and I'd rather not
have to add code to set them twice. If I only set them in the code
behind then the designer view doesn't look right.

Any ideas?

Tony
Nov 19 '05 #1
5 1262
Hi,

U can make CSSClass file for ur application , make a new class in it as per
ur requirement and use it for ur textbox.

Meena.

"Tony Brand" <to*******@example.com> wrote in message
news:#U**************@TK2MSFTNGP12.phx.gbl...
Hi,
Is there a way to force .NET to add styles to controls to display
properties as set in the VS.NET designer? I'm using Visual Studio.NET
2002, and therefore 1.0 .NET framework.

For example, I've created a page that has a textbox control with its
width set in the VS.NET designer. When the page is displayed in IE6 it
has the style added to the input field to display it how I wanted:

<input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
id="LeftMenu_txtMiniAge" style="width:34px;" />

However when I view the same page in the latest Mozilla the styles
aren't added and I get:

<input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
id="LeftMenu_txtMiniAge" />

In fact I'm not getting styles added to any controls in Mozilla unless I
explicitly set them in the code behind file, eg:

txtMiniAge.Style.Add("width", "34px")

Its much easier to set the properties in the designer and I'd rather not
have to add code to set them twice. If I only set them in the code
behind then the designer view doesn't look right.

Any ideas?

Tony

Nov 19 '05 #2
Meena Desai wrote:
Hi,

U can make CSSClass file for ur application , make a new class in it as per
ur requirement and use it for ur textbox.

Meena.


Hi Meena,
I had considered that but I've inherited a site that doesn't display
properly in some browsers and I guess I'm looking for an easy solution.
So rather than go through and set CSS classes I just wondered if I could
get .NET to add the relevent styles it already has.

Thanks for the suggestion.

Regards
Tony
Nov 19 '05 #3
Tony Brand wrote:
Hi,
Is there a way to force .NET to add styles to controls to display
properties as set in the VS.NET designer? I'm using Visual Studio.NET
2002, and therefore 1.0 .NET framework.

For example, I've created a page that has a textbox control with its
width set in the VS.NET designer. When the page is displayed in IE6 it
has the style added to the input field to display it how I wanted:

<input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
id="LeftMenu_txtMiniAge" style="width:34px;" />

However when I view the same page in the latest Mozilla the styles
aren't added and I get:

<input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
id="LeftMenu_txtMiniAge" />

In fact I'm not getting styles added to any controls in Mozilla unless I
explicitly set them in the code behind file, eg:

txtMiniAge.Style.Add("width", "34px")

Its much easier to set the properties in the designer and I'd rather not
have to add code to set them twice. If I only set them in the code
behind then the designer view doesn't look right.

Any ideas?

Tony


Maybe you need to look into "browser caps", to have asp.net
treat Mozilla as "up level" browser.
--
Hans Kesting
Nov 19 '05 #4
Hans Kesting wrote:


Maybe you need to look into "browser caps", to have asp.net
treat Mozilla as "up level" browser.

Hi Hans, this looks very promising, thank you.

Tony
Nov 19 '05 #5
add this code to onload:

if ("netscape|gecko|opera".IndexOf (this.Request.Browser.Browser.ToLower())
=0 )

this.ClientTarget = "Uplevel";

-- bruce (sqlwork.com)
"Tony Brand" <to*******@example.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
| Hi,
| Is there a way to force .NET to add styles to controls to display
| properties as set in the VS.NET designer? I'm using Visual Studio.NET
| 2002, and therefore 1.0 .NET framework.
|
| For example, I've created a page that has a textbox control with its
| width set in the VS.NET designer. When the page is displayed in IE6 it
| has the style added to the input field to display it how I wanted:
|
| <input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
| id="LeftMenu_txtMiniAge" style="width:34px;" />
|
| However when I view the same page in the latest Mozilla the styles
| aren't added and I get:
|
| <input name="LeftMenu:txtMiniAge" type="text" maxlength="3"
| id="LeftMenu_txtMiniAge" />
|
| In fact I'm not getting styles added to any controls in Mozilla unless I
| explicitly set them in the code behind file, eg:
|
| txtMiniAge.Style.Add("width", "34px")
|
| Its much easier to set the properties in the designer and I'd rather not
| have to add code to set them twice. If I only set them in the code
| behind then the designer view doesn't look right.
|
| Any ideas?
|
| Tony
Nov 19 '05 #6

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

Similar topics

8
by: Ryan Stewart | last post by:
Is there a way to reset the style property of an HTML element to some default or to all empty values? I have a group of elements whose style settings may be changed arbitrarily at certain points in...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
3
by: Tim Zych | last post by:
When I use IE, the textbox on my webform is normal. When I use Mozilla Firebird, the textbox is tiny and it is impossible to type text into it. What must I do to make the textbox viewable with...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
8
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...
7
by: Sandy | last post by:
Hello - I have a form that when submitted checks the database and if the username is already taken, a label shows indicating same. I need to make that label NOT visible after the user clicks...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
3
by: Stephen Costanzo | last post by:
This is my first attempt at working with style sheets so I am probably missing something obvious. I created a default ASP.NET Web Application and added 3 elements to it, a label, a text box, and...
0
by: AndySummers | last post by:
Hi We have just re-written a majour asp.net project to use a user control embedded in a web page. The main dll references 3 other custom controls and so to deploy the project I copy the 4 dll's to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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,...
0
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...

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.