By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,293 Members | 1,397 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,293 IT Pros & Developers. It's quick & easy.

defaultbutton, defaultfocus and rendering in Internet Explorer

P: n/a
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
May 5 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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!
*************************************************
"Oz Kologlu" <oz*******@nowhere.com> wrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
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

May 5 '06 #2

P: n/a
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>

"Oz Kologlu" <oz*******@nowhere.com> wrote in message
news:%2******************@TK2MSFTNGP03.phx.gbl...
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

May 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.