views:

482

answers:

6

How can we make asp.net website compatible in all browser. In my case the webpage looks fine in IE 7.0 and above but in another browser like Google crome, Firefox, Netscape etc, the web page content detroy in layout.

+2  A: 

This is a massive question with a multitude of answers.

It's entirely down the browser's CSS rendering engine. Browsers tend to render CSS in different ways, so you just have to tweak until it works.

Also, browsers aren't all compatible with the various CSS versions. I.e. CSS3.0 has a number of features that just aren't supported in IE and Firefox, but work very nicely in Safari.

GenericTypeTea
Is there any standard method because it effects our target line of projects
Hemant Kothiyal
You mean a standard method like... this.FixAllCss()? No that doesn't exist and never will. You need to tinker your CSS and HTML so that all browsers display the page the same way.
GenericTypeTea
A: 

You'll need to pay attention to the HTML/CSS that ASP.NET renders. If you are using WebForms (standard ASP.NET), the controls render a lot of strange HTML/CSS (by default) that you will need to wrangle with.

mgroves
Thanks , but i think there should be some standard way of doing this task
Hemant Kothiyal
don't we all...
mgroves
+5  A: 

Microsoft has a new tool (SuperPreview) that can help iron out those cross-browser issues. But I agree with GenericTypeTea ... this is a complex problem and is down to the way browsers render your CSS.

Chris Nicol
+1 First time I see that.
Wadih M.
+1 That looks like an awesome tool, thanks Chris!
GenericTypeTea
Thanks Chris. I will explore superpreview. Hopefully it solve our problem
Hemant Kothiyal
SuperPreview will NOT solve your problem, it will help you identify where the problem with your HTML/CSS lies so YOU can fix it.
GenericTypeTea
I agree with GenericTypeTea ... superpreview will not solve your problem, it will only identify differences so you can be more effective in solving your cross browser issues. It still comes down to understanding CSS rendering and being able to modify your site until it meets all your requirements
Chris Nicol
A: 

there many aspects but the only thing i can recommend is use a grid system link 960.gs and use a reset.css

hope this helps

Can you please tell me more about grid system link 960.gs and reset.css.
Hemant Kothiyal
+1  A: 

Here's on popular solution to this problem: Simplify your page.

If it doesn't render the same in all browsers, you have used an IE-only feature. Take the feature out.

S.Lott
Not necessarily. IE, FF, Safari, Etc all have their own idiosyncrasies that can make them render divs differently based on inheritance, content, 100% height/width settings, etc.
GenericTypeTea
A: 

What version of ASP.NET are you using? Older versions had some funky browser capability settings that you may need to tweak. http://www.mitchelsellers.com/blogs/articletype/articleview/articleid/1/making-aspnet-11-work-with-firefox.aspx

Greg