473,796 Members | 2,524 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_tx tMiniAge" style="width:34 px;" />

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_tx tMiniAge" />

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.Styl e.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 1277
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*******@exam ple.com> wrote in message
news:#U******** ******@TK2MSFTN GP12.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_tx tMiniAge" style="width:34 px;" />

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_tx tMiniAge" />

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.Styl e.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_tx tMiniAge" style="width:34 px;" />

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_tx tMiniAge" />

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.Styl e.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|geck o|opera".IndexO f (this.Request.B rowser.Browser. ToLower())
=0 )

this.ClientTarg et = "Uplevel";

-- bruce (sqlwork.com)
"Tony Brand" <to*******@exam ple.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.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_tx tMiniAge" style="width:34 px;" />
|
| 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_tx tMiniAge" />
|
| 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.Styl e.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
9558
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 a script (maybe set the background color and font weight of one element and the text align of another), but at another point I want to undo all of these changes and go back to the original state (which is actually all empty styles). Is there a...
19
2989
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 provide an open TD with a DIV in it for the content of this formlet. (The DIV is for DHTML to hide and show the content) I've created a web page showing step by step the two problems I'm encountering. This problem is much easier to see than it...
3
1220
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 Mozilla?
2
3921
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 javascript checks for things like valid e-mail addresses or phone numbers (without having to add a separate control for validation). One idea I did some work on was having the control implement the IValidator interface and basically recreating...
8
3527
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; }
7
4624
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 in the username textbox to change the name. Any help will be greatly appreciated!
2
19876
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
2583
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 a hyperlink. I changed the default style sheet to have the label color be purple (added color: purple; to the Body {}). I changed the hover for the hyper link to lime (changed color: lime; in the
0
1714
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 the server and the web page loads the control via the <object> tag. I have also added a iexplore.exe.config file (because of another thread) where I specify that .net v1.1 should be used. (The controls have been developed in VS2003) I have also...
0
9679
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9527
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
10453
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
10223
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...
1
10172
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7546
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
6785
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
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4115
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.