Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP.Net Style Sheets

Status
Not open for further replies.

Creepers

Programmer
Nov 11, 2002
116
US
I am developing in ASP.Net (Version 1.1). The CSS file renders objects correctly on IE. However, the are not rendering correctly on FireFox.
Can someone supply a fix or a link to a fix? Or supply a work around?
 
We can't provide a fix if we don't know what the problem is (simply saying "The CSS file renders objects correctly on IE" doesn't show what the problem is and is most likely incorrect anyway).

Internet Explorer is notorious for not being standards compliant so it's probably one of those many problems that is causing your page to display correctly in FireFox but incorrectly in IE.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
IE and FF use different rendering engines. FF strictly follows WC3 standards and IE does not. So, FF is probably rendering it "correctly" and IE is doing it's own thing. This is pretty common. You'll need to post your code. Also you might have better luck in the CSS forum ( forum215 ).

J
 

Adapt this script to your needs.
This works just fine for me :)


Code:
function getBrowser(/* As String */ Header, /* As String */ Footer)
{
	var myHeader = document.getElementById(Header);
	var myFooter = document.getElementById(Footer);
		
	if(navigator.userAgent.indexOf("Firefox")!=-1)
	{
        var versionindex=navigator.userAgent.indexOf("Firefox")+8
        if (parseInt(navigator.userAgent.charAt(versionindex))>=1)
        {
		    // apply when Firefox is the browser
		    myHeader.className = "Fox_Header";
		    myFooter.className = "Fox_Footer";
        }
        else
        {
		    // apply when MSIE is the browser
		    myHeader.className = "MSIE_Header";
		    myFooter.className = "MSIE_Footer";
        }
    }
}


After that all you need to do is:

Code:
<body onload="getBrowser('HeaderTable','FooterTable');">
 
There's no need to use a browser sniffing method like the one posted above. Especially as this will fail if the user doesn't have javascript turned on or their browser doesn't support it.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
When I see this, it is normally an IE issue. Check the <!Page directive, you may find that changing it from transitional to strict means that both ie and ff render the same
 
Thanks for everyone's responses. I am new (less than 6 months) to ASP.Net. When new at something, some times it is difficult for me to ask the correct question.

The objects that are not rendering correctly are tables, rows and cells that I have programmatically created. These objects are server objects. My thought is that if I makes these htmlTables, htmlRows, htmlCells then this issue will go away?!? Does anyone have any thoughts?
 
I dont think that will make any difference (Sorry). The rendering / display is down to how the 2 browsers are interpreting the html.

Try to run the page, and then do a file / view source, save as to grab the html. Save that as a seperate html page, and open it in firefox. If it appears different, then it is down to the way the 2 browsers are working, and you'll need to figure out your css problems

K
 
It's almost certainly a IE rendering issue and nothing to do with which controls you use. There are many IE workarounds, you'll just have to find which one to use. Also, try posting the resulting HTML in the HTML forum as they will be best placed to help you.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top