我正在使用DotNetOpenAuth-3.3.0.9302每晚构建,我遇到了一个问题,如果openidajaxtextbox放在更新面板中,它会阻止autopostback事件触发。所以我做了一个简单的例子来说明问题。
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %>
<%@ Register Assembly="DotNetOpenAuth" Namespace="DotNetOpenAuth.OpenId.RelyingParty"
TagPrefix="openid" %>
<!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></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<openid:openidajaxtextbox id="OpnIdAjxTxtB" runat="server" onloggingin="OpnIdAjxTxtB_LoggingIn"
onloggedin="OpnIdAjxTxtB_LoggedIn" onclientassertionreceived="onauthenticated(sender)"
onunconfirmedpositiveassertion="OpnIdAjxTxtB_UnconfirmedPositiveAssertion"
identifierrequiredmessage="Vänligen kontrollera OpenID innan du fortsätter."
logoninprogressmessage="Vänligen vänta tills OpenID inloggningen har slutförts."
logontext="LOGGA IN" logontooltip="Klicka här för att logga in med ett popup-fönster."
retrytext="FÖRSÖK IGEN" retrytooltip="Försök igen att hitta en misslyckad identifierare."
authenticationfailedtooltip="Verfifieringen misslyckades" authenticatedastooltip="Verfierad som {0}."
authenticationsucceededtooltip="Verfierad av {0}." busytooltip="Verfiferar"
autopostback="True" CssClass="M_TxtB" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<br />
<asp:Label ID="Label1" runat="server" Text="1"></asp:Label>
<br />
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True" Text="test" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
Imports DotNetOpenAuth.OpenId.Extensions.SimpleRegistration
Imports DotNetOpenAuth.OpenId.RelyingParty
Partial Class test
Inherits System.Web.UI.Page
Protected Sub OpnIdAjxTxtB_LoggedIn(ByVal sender As Object, ByVal e As DotNetOpenAuth.OpenId.RelyingParty.OpenIdEventArgs)
If OpnIdAjxTxtB.AuthenticationResponse.Status = AuthenticationStatus.Authenticated Then
' do something
End If
End Sub
Private _runOnes As Nullable(Of Boolean)
Protected Sub OpnIdAjxTxtB_LoggingIn(ByVal sender As Object, ByVal e As DotNetOpenAuth.OpenId.RelyingParty.OpenIdEventArgs)
' Retrieve the email address of the user
If Not _runOnes.HasValue Then
Dim c As New ClaimsRequest
c.Email = DemandLevel.Require
e.Request.AddExtension(c)
_runOnes = True
End If
End Sub
Protected Sub OpnIdAjxTxtB_UnconfirmedPositiveAssertion(ByVal sender As Object, ByVal e As DotNetOpenAuth.OpenId.RelyingParty.OpenIdEventArgs)
' This is where we register extensions that we want to have available in javascript
' on the browser.
OpnIdAjxTxtB.RegisterClientScriptExtension(Of ClaimsResponse)("sreg")
End Sub
Protected Sub CheckBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
Label1.Text = Label1.Text + 1
End Sub
End Class
此代码只是增加标签中的数字。所以通过将openidajaxtextbox放在updatepanel中,我可以增加标签号,只是其他所有事件似乎都没有被触发。但是如果openidajaxtextbox放在updatepanel之外,则代码按预期工作。
安德鲁怎么了?我错过了什么:)