I'm having a bit of an issue with the DefaultButton in FireFox... consider the following simple code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test.aspx.vb" Inherits="Test" %>
<!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>Test</title>
</head>
<body>
<form id="frmMain" runat="server">
<asp:ScriptManager ID="smManager" runat="server" />
<div>
<%-- <asp:UpdatePanel ID="updTest" runat="server">
<ContentTemplate>
--%> <asp:Panel ID="pnl1" runat="server" DefaultButton="btn1">
This is panel 1.
<asp:TextBox ID="txt1" runat="server" />
<asp:Button ID="btn1" runat="server" Text="Go to panel 2" OnClick="btn1_Click" />
</asp:Panel>
<asp:Panel ID="pnl2" runat="server" DefaultButton="btn2" Visible="False">
This is panel 2.
<asp:TextBox ID="txt2" runat="server" />
<asp:Button ID="btn2" runat="server" Text="Go to panel 1" />
</asp:Panel>
<%-- </ContentTemplate>
</asp:UpdatePanel>
--%> </div>
</form>
</body>
</html>
as well as the following code behind:
Partial Class Test
Inherits System.Web.UI.Page
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click
pnl1.Visible = False
pnl2.Visible = True
End Sub
Protected Sub btn2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn2.Click
pnl1.Visible = True
pnl2.Visible = False
End Sub
End Class
As this is written, it works 100% fine in both IE and FireFox. However, if you uncomment out the code in the first script above, it will work fine in IE, but FireFox just does a plain postback to the UpdatePanel, and it doesn't seem to be generating the click event.
Any ideas how to solve this?