Search code examples
asp.netinternet-explorerwindow.openquirks-mode

Document Mode changed to Quirk when opening a new tab on IE (ASP.NET)


I have a button click event that do some server side job and finally open a new tab. But when that happens, the parent tab on Internet Explorer become very bizarre. Then I found Document Mode is changed to Quirk mode that make the whole website move to left instead of centre and I lost some styling as well. I tried with the code below but still happen.

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

Can anyone tell me why that is happening and how to solve this? Thanks.

My code sample.

    Sub btnTeachersView_Click
    ........ server side code ........
    Response.Write("<script>")
    Response.Write("window.open('../abc.aspx','_blank')")
    Response.Write("</script>")
    End Sub

NOTE: It needs to be on server side coz there are other jobs need to be done first and my client wants it in a new tab so i can't just redirect to that page.


Solution

  • Try to wrap your <script></script> tags in the correct <html></html> tags with doctype etc. I think that might be the problem that triggers quirks mode, the lack of proper dtd