ASP.NET 4.0 website works fine in IE9. But javascript and alignment issue in IE11

ashok.k

Member
Joined
Nov 17, 2014
Messages
14
Programming Experience
5-10
Hi,


I am working on a ASP.NET website which is being developed using Visual studio 2010. Target framework is 4.0.




Website is hosted on windows 2003 machine running IIS 6.


website works fine in IE9 and chrome. But some javascript functions does not work fine when I access the website using IE11.


I also see some alignment issues when I access the website using IE11.


I added the below line above head secion of every page and the alignment issues is resolved. But the Javascript functions still does not work as it works in IE9. I am using a javascript function to check/uncheck all rows in a gridview when the header checkbox is checked/unchecked. It works fine in IE9 and chrome but in IE11, it does not select/deselect the checkbox in the first row of the grid view.


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


Why the web page does not render properly when accessed using IE11 when it works fine in IE9 and Chrome.










<asp:GridView ID="gdvData" Height="400px" HorizontalAlign="Center"
runat="server" HeaderStyle-BackColor="#33CCFF" HeaderStyle-CssClass="FixedHeader"
AutoGenerateColumns="false" AlternatingRowStyle-BackColor="WhiteSmoke"
style="height:200px; width:700px; overflow:auto;">
<Columns>

<asp:TemplateField HeaderText="Select Column"
HeaderStyle-Width="45px" ItemStyle-Width="45px">


<HeaderTemplate>
<asp:CheckBox ID="chkboxSelectAll" Checked="false" runat="server" onclick="CheckUnCheckAllRows(this)" ></asp:CheckBox>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelectRow" runat="server" Checked="false" Text=""> </asp:CheckBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>


</asp:GridView>




<script type="text/javascript" language="javascript">


function CheckUnCheckAllRows(CheckboxHeader)
{
var GridVwHeaderChckbox = document.getElementById("<%=gdvData.ClientID %>");

for (i = 1; i < GridVwHeaderChckbox.rows.length; i++) {
GridVwHeaderChckbox.rows.cells[0].children[0].checked = CheckboxHeader.checked;



}
}


</script>


What changes are required to make the javascript functions work in IE11 as they work in IE9?


Thanks
Ashok
 
Back
Top Bottom