defaultbutton, defaultfocus and rendering in Internet Explorer

O

Oz Kologlu

Hi folks,

IE and Asp.net 2.0 are doing some pretty bizzare things. Some of our users
were getting pretty weary of IE redrawing and "flashing" what is essentially
a pretty static page every time there is a postback (IE Version
6.0.2900.2180.xpsp_sp2,,,,; Doesn't happen under firefox - bless those
folks).

Anyway try this:

<form id="form1" runat="server" defaultbutton="FlashMe">
<table bgcolor="lime" height="100">
<tr><td>Am I gonna flash?</td></tr>
<tr><td><asp:Button runat="server" ID="FlashMe" Text="Flash Me" /></td></tr>
</table>
</form>

You will see the whole screen flash when you postback. Now, remove the
defaultbutton="FlashMe" from the form and try again.
See: No FLASH!!!!!
The same happens when you define defaultfocus.What gives?

Maybe someone needs to sit with IE guys and work out how to write script
file (WebResource.axd) that doesn't cause IE to kick itself in the arse!

Anyone got a suggestion?

Thanks,
Oz
 
C

Cowboy \(Gregory A. Beamer\)

You can alwasy default using Code Beside (formerly Code Behind in ASP.NET
1.x). I am fairly certain the issue lies in the mechanism to default a
specific button. JavaScript is also an option, but that is likely what
ASP.NET 2.0 is using (have not played with that mechanism yet).

My suspicion of JavaScript comes from the fact it paints and then repaints.
It is likely this happens on ALL browsers, but it is not noticeable on
others as it is happening so fast. Firefox may have used a different method
to solve it, however, so my statement is possibly incorrect.

I would look up default button on ASP.NET 1.x and try that method and see if
it causes the same issue.

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
 
O

Oz Kologlu

After much hunting I can put a name to the problem:

No folks, it not what's defined in:
http://www.urbandictionary.com/define.php?term=fouc
Though it certainly feels that way.


It is in fact: the Flash Of Unstyled Content
http://www.bluerobot.com/web/css/fouc.asp

The fix suggested still does not work. Anyone have any ideas?

Oz
Following is the test page including the suggested fix from bluerobot.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Flash.aspx.cs"
Inherits="Flash" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript"> </script>
</head>
<body>
<form id="form1" runat="server" defaultbutton="FlashMe">
<table bgcolor="lime" height="100">
<tr><td>Am I gonna flash?</td></tr>
<tr><td><asp:Button runat="server" ID="FlashMe" Text="Flash Me" /></td></tr>
</table>
</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top