For the sake of completeness, here is the reply I got from the ASP.NET support folks
Subject: SRX04020960045
*** Problem Description **
Customer has an asp.net application with a dropdown menu and enable autopostback in
a fram
When users selects an item, it will do a postback to server. Before the postback
completes and the page refreshes, click the dropdown menu agai
the frame page will become blank out
Repro files
Main.ht
<html><frames et cols="150,*"><f rame name="contents" src=""><frame name="main" src="WebForm1.a spx"></frameset></html
WebForm1.aspx
<%@ Page language="c#" Codebehind="Web Form1.aspx.cs" AutoEventWireup ="false"
Inherits="nasty Bug.WebForm1" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" ><HTML><body MS_POSITIONING= "GridLayout " bgColor="lime"> <form id="Form1" method="post" runat="server"> <asp:DropDownLi st id="DropDownLis t1" style="Z-INDEX: 101; LEFT: 29px; POSITION:
absolute; TOP: 27px" runat="server" Width="122px" AutoPostBack="T rue"><asp:ListI tem Value="one">one </asp:ListItem><a sp:ListItem Value="two">two </asp:ListItem><a sp:ListItem Value="three">t hree</asp:ListItem><a sp:ListItem Value="four">fo ur</asp:ListItem></asp:DropDownLis t></form></body></HTML><><><><><> <><><><><><><>< ><><><><><><><> <><><><><><><>< ><><><><><><><> <><><><>
*** Resolution *** Jul 18 2003 12:16PM Amylu
Cause/Resolution
This is a bug with Internet explorer 6.0 sp1.
The original bug, it is closed and moved to longhorn and customer accept
workaroun
http://bugcheck/default.asp?URL=/Bugs/IEOESE/24828.as
New bug: windows bug: 74346
http://bugcheck/default.asp?URL=/Bug...Bugs/743465.as
In the meanwhile, we can workaround the problem by creating a client side onchange
event handler and delay the postback of a second
A better sample suggest by earlb
//need this using for the stringbuilder clas
using System.Text
private void Page_Load(objec t sender, System.EventArg s e
DropDownList1.A ttributes.Add(" onchange","test delay();")
Page.RegisterCl ientScriptBlock ("dropdown1",Cr eateClientFunct ion(DropDownLis t1.Uniqu
ID));
private string CreateClientFun ction(string str
StringBuilder func = new StringBuilder()
func.Append("<s cript language=\"jscr ipt\">")
func.Append("fu nction testdelay(){")
func.Append("se tTimeout(\"__do PostBack('" + str + "','')\", 1);")
func.Append("}" )
func.Append("</script>")
return func.ToString()
=============== =============== =============== =============== =============== ========
=============== =============== =============== =
Another code sample snippet (SRX02051660244 4) to workaround this problem, this puts
the script function at the before the starting HTML tag
private void Page_Load(objec t sender, System.EventArg s e
//create client site onchange even
DropDownList1.A ttributes.Add(" onchange","test delay()")
WriteFunction(D ropDownList1.Un iqueID)
// Put user code to initialize the page her
private void WriteFunction(s tring str
Response.Write( "<script
language=\"jscr ipt\">")
Response.Write( "function testdelay(){")
Response.Write( "setTimeout(\"_ _doPostBack('" +
str + "','')\", 1);")
Response.Write( "}")
Response.Write( "</script>")
VB.NET code Snippet
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Loa
'Put user code to initialize the page her
ListBox1.Attrib utes.Add("oncha nge", "testdelay( )"
WriteFunction(L istBox1.UniqueI D
End Su
Private Sub WriteFunction(B yVal str As System.String
Response.Write( "<script language=""jscr ipt"">"
Response.Write( "function testdelay()")
Response.Write( "{")
Response.Write( "setTimeout (")
Response.Write( """__doPostBack ('DropDownList1 ','')"", 1);")
Response.Write( "}")
Response.Write( "</script>")
End Sub
Michael Graham, MCSD
Microsoft Developer Support
(980) 776-9966
mg*****@microso ft.com
Delighting our customers is our top priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please mail us at
ma******@micros oft.com. You can also contact my manager:
Jeremy Chapman
Middleware Team Manager
Office (469) 775-6360
Email -
je*****@microso ft.com
Recent viruses on the Internet underscore the threat to all computer users and highlight challenges facing the entire industry in providing security that everyone needs to conduct business. I encourage you to sign up to receive automatic notification of Microsoft Security Bulletins by visiting
http://www.microsoft.com/technet/tre...tin/notify.asp. For more information on security, our Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security. We will be happy to answer any questions or provide assistance with your security needs.