Browser / Document Compatibility

While changing a client's existing code, I ran into some compatibility issues with IE9 and some existing code.  The client had only tested up to IE8 with the current release but their customers were having issues with what turned out to be IE9 and its ability to process the same JavaScript.  So the client would not have to change the custom control immediately, I added the following to the Master Page:
<head runat="server">
    <title>master title</title>
    <%--Mimic Internet Explorer 8--%>
    <meta http-equiv="X-UA-Compatible" content="IE=8" />
</head> 

 
And while I was looking for the Meta tag syntax, I ran into this which I didn't realize .Net could do:
<asp:Label runat="server" ID="labelText"
    ie:Text="This is IE text"
    mozilla:Text="This is Firefox text"
    Text="This is general text"
/>   


<asp:Button runat="server" ID="buttonText"
    ie:Text="IE Button"
    ie:OnClientClick="javascript:alert('Hello IE!');"
    mozilla:Text="FF Button"
    mozilla:OnClientClick="javascript:alert('Hello Firefox!');"
    Text="General Button"
    OnClientClick="javascript:alert('Hello everyone else!');"
/>


Comments

Popular posts from this blog

Debug VBScript / VBS files in Visual Studio 2010

A good use of Common Table Expressions

Setting Up Visual Studio Environment for Selenium