Мне удалось решить проблему вот код:
Master.master:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Panel ID="defaultPanel" CssClass="Default_Panel" runat="server" Visible="true">
<ul id="loginLinks">
<li><asp:LinkButton ID="lnkSignIn" class="last" runat="server" Visible="true" Text="sign in"></asp:LinkButton></li>
</ul>
<!-- Login Pop Ajax Control Tool Kit -->
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server" CancelControlID="btnClose" PopupControlID="pnlSignIn" TargetControlID="lnkSignIn"></ajaxToolkit:ModalPopupExtender>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="pnlSignIn" runat="server">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<table width="100%" border="0" cellpadding="2" cellspacing="5">
<tr>
<td style="width: 35%; padding-top: 50px;">
</td>
<td>
<asp:Label ID="labMsg" runat="server" ForeColor="Red" EnableViewState="false" />
</td>
</tr>
<tr>
<td align="right" valign="middle">
<strong>Login ID :</strong>
</td>
<td>
<asp:TextBox ID="txtLogin" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right" valign="middle">
<strong>Password :</strong>
</td>
<td>
<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnOk" runat="server" Text="Sign In" OnClick="btnOk_Click" />
<asp:Button ID="btnClose" runat="server" Text="Cancel" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
Примечание: теперь 2 панели обновлений, удалено подтверждение подтверждения.
Я действительно не знаю, почему метод входа не срабатывал раньше и почему он работает сейчас.
Master.master.cs:
protected void btnOk_Click(object sender, EventArgs e)
{
var name = txtLogin.Text;
var pwd = txtPassword.Text;
DataSet ds = new DataSet();
string userName = name;
string pwdBeforeConversion = pwd;
//Encryption of pasword
SHA1CryptoServiceProvider x = new SHA1CryptoServiceProvider();
byte[] data = Encoding.ASCII.GetBytes(pwdBeforeConversion);
data = x.ComputeHash(data);
//pass the data to service, and get a return as dataset
try
{
somelogic here
}
catch (Exception ex3)
{
if (ex3.Message == "InvalidUsernameOrPassword")
labMsg.Text = "sorry user name and password could not be found";
else if (ex3.Message == "EmailNotVerified")
labMsg.Text = "please contact ta; email is not verified";
else if (ex3.Message == "AccountDisabled")
labMsg.Text = "please contact ta; account is not verified";
else
labMsg.Text = "sorry we encounterd a techncal issue, please try logging in again";
ModalPopupExtender1.Show();
return;
}
}