473,408 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

defaultbutton, defaultfocus and rendering in Internet Explorer

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
2 1699
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Matt Probert | last post by:
Is it just me (probably) or is Mozilla and the newer Firefox full of CSS rendering bugs? I ask, because some strange effects occur with Mozilla and Firefox which don't happen in Opera and dare I...
0
by: Yarik | last post by:
Hello, When I open an HTML document by Internet Explorer 6 and then print the document on a color inkjet printer, some of the colors are rendered incorrectly (they appear much darker than they...
3
by: dpomt | last post by:
I am facing some issues with the webforms DefaultButton functionality: #1 One text box ==> hitting enter works in IE but not in Firefox (1.5) #2 One text box and req. field validator ==> problem...
5
by: Tyler Carver | last post by:
I have found a situation where the DefaultButton and DefaultFocus stop working under FireFox. I'm looking for any kind of fix or work around. The problem seems to happen when setting a control...
0
by: Tim_Mac | last post by:
i say "bug" in quotes because i can't really blame microsoft for a feature not working in a non-microsoft browser. However, i would have preferred if they did some better browser testing! if i...
7
by: Tim_Mac | last post by:
this is a re-post of an earlier message. i'm posting it under my MSDN alias for a better chance of reply :) when you press return in a multiline textbox, you expect to insert a newline. ...
2
by: =?Utf-8?B?QmlnSm9obg==?= | last post by:
We can set the default button and focus field in ASP.Net 2.0 on the Form tag. My form tag is in the Master page, but the controls are in containers. I read through a few articles which did not...
4
by: Tim Mackey | last post by:
hi, asp.net 2. can anyone explain why this code does not work in firefox (2.0.0.1), but does work in IE 7. if you hit enter after typing something into the textbox, it should fire the Submit...
9
by: Veerle | last post by:
Hi, When you use multiple asp:Buttons on one Form, then asp.net generates html submit buttons for all of them. When you put your cursor in one of the textfields of the form, the default submit...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.