473,383 Members | 1,821 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,383 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 1359
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.
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.