472,805 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Cross-browser compat. question

Hi everybody,

I was doing some cross-browser tests today and I found out that if you
specify the width and height for a button type control, asp.net doesn't
output the style information when viewing the page with the latest version
of firefox. I copy-pasted the page source to an html file and opened it
with firefox and the styles were applied to the button with no problem. My
question is then this: Is there a way to control what ASP.NET outputs to
the browser or alter in some way its browser detection? It's a good thing
to suppress style information and functionality that browsers don't support,
but it's another when the browser in fact supports it. I suppose that for
microsoft, it basically boils down to "our browser" and "the others", but I
thought I would ask anyway.

Thanks for any help or insight!

Eric.
Nov 18 '05 #1
2 1332
Hi Eric,

Right now there isn't a totally easy way to have it span ASP.Net. However
you can do this manually without a lot of trouble. Basically you can
subclass a control (i.e. Button) and override the Render event so that you
output HTML that will be cross browser compatible. Then for each button you
place in all your applications you have them inherit from the Button that
you created.

Inside the Render event you can test for the browser type but an easier way
is to create an Enum of all the browsers you support. Then in the
contructor of your button set an internal property for the type of browser
detected. If it is one you support or need to do something for use that
enum to determine what to output. If it isn't a browser you have specific
support for you can call the base object Render event or create a real
scaled down plain option that should work with every browser.

Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Eric Caron" <ec****@nospam.quebecaffaires.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi everybody,

I was doing some cross-browser tests today and I found out that if you
specify the width and height for a button type control, asp.net doesn't
output the style information when viewing the page with the latest version
of firefox. I copy-pasted the page source to an html file and opened it
with firefox and the styles were applied to the button with no problem. My question is then this: Is there a way to control what ASP.NET outputs to
the browser or alter in some way its browser detection? It's a good thing
to suppress style information and functionality that browsers don't support, but it's another when the browser in fact supports it. I suppose that for
microsoft, it basically boils down to "our browser" and "the others", but I thought I would ask anyway.

Thanks for any help or insight!

Eric.

Nov 18 '05 #2
force asp.net to behave, try:

private void Page_Load(object sender, System.EventArgs e)
{
if ("netscape|gecko|opera".IndexOf(this.Request.Brows er.Browser.ToLower())
=0 ) this.ClientTarget = "Uplevel";
}

-- bruce (sqlwork.com)

"Eric Caron" <ec****@nospam.quebecaffaires.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl... Hi everybody,

I was doing some cross-browser tests today and I found out that if you
specify the width and height for a button type control, asp.net doesn't
output the style information when viewing the page with the latest version
of firefox. I copy-pasted the page source to an html file and opened it
with firefox and the styles were applied to the button with no problem. My question is then this: Is there a way to control what ASP.NET outputs to
the browser or alter in some way its browser detection? It's a good thing
to suppress style information and functionality that browsers don't support, but it's another when the browser in fact supports it. I suppose that for
microsoft, it basically boils down to "our browser" and "the others", but I thought I would ask anyway.

Thanks for any help or insight!

Eric.

Nov 18 '05 #3

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

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
3
by: rollasoc | last post by:
Hi, Doing a bit of system testing on a Windows 98 laptop. (.Net 1.1 app). Did a bit of testing. Loaded a previously saved file. A gray box appeared with the text and buttons all white...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
4
by: David Peach | last post by:
Hello, hope somebody here can help me... I have a query that lists defects recorded in a user defined date range. That query is then used as the source for a Cross Tab query that cross-tabs count...
23
by: Jeff Rodriguez | last post by:
Here's what I want do: Have a main daemon which starts up several threads in a Boss-Queue structure. From those threads, I want them all to sit and watch a queue. Once an entry goes into the...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
7
by: Scott M. | last post by:
How can I disable the cross-site scripting check for one particular page of a site?
8
by: Pieter | last post by:
Hi, I'm having some weird problem using the BackGroundWorker in an Outlook (2003) Add-In, with VB.NET 2005: I'm using the BackGroundWorker to get the info of some mailitems, and after each item...
6
by: ampo | last post by:
Hello. Can anyone help with cross-domain problem? I have HTML page from server1 that send xmlHTTPRequest to server2. How can I do it? Thanks.
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.