Tuesday, June 1, 2010

Many people send a mail to me that to make older aspx pages to be browsed accuratley on IE8 as they were browsed on IE7.

Just add this following

http-header (X-UA-Compatible: IE=EmulateIE7).


but what’s the problem ?
Why does the problem occurred from beginning?


when the server controls be rendered as html on client m/c it has 2 attributes :

id (_ separated, which is the clientID of the control)
name($ separated which is control uniqueID)

when you call the JavaScript built-in function object.getElementById(ServerControl.ClientID) ,it finds the control and return the control as object;

also if you call it as  object.getElementById(ServerControl.UniqueID) it finds the control and also return the control as object.


That because it treats the control ‘s id and name as IDs,

and that is not the standard (if u call the previous fun, and browse the page within firefox. it will return null and that’s the standard.



but Microsoft beginning from ie8 and later will  treat the clientID(_ separted) as ID, and uiqueID($ separated) as control name.

and to make ie8 behaves like ie7 u can add the above http-header to your website or to all your websites within the IIS tool.

and it can be per page by adding the following meta tag

                        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

but still many things don’t run on Firefox or other browers than ie because Microsoft uses custom JavaScript library which is written within resource.xsd files.

for example there is a client javascript fun (private for Microsoft)  for enabling and disabling validators [ the fun is ValidatorEnable(objected,bool)]

if u browse it in firefox it will give parsing errors.

People, that’s the hell of Microsoft.

C# fast-food by:
Eng.Waleed abou-zaid
Senior Software Developer
Harf Information Technology
MCSD.Net,MCAD.Net,MCP,A+,N+ certified
walid.abouzaid@gmail.com



1 comments:

IP based security Miami said...

Love this post, and also love Moomin!