C#]
<html>
<head>
<script language="C#" runat=server>
void SubmitBtn_Click(Object Source, EventArgs E)
{
// Pull credentials from form fields and try to authenticate.
if (FormsAuthentication.Authenticate(UserName.Value,
UserPassword.Value))
{
FormsAuthenticationTicket ticket = new
FormsAuthenticationTicket(UserName.Value, false, 5000);
FormsAuthentication.RedirectFromLoginPage(UserName.Value,
PersistForms.Checked);
}
}
</script>
</head><body><form method=post runat=server>
<table>
<tr>
<td>Name:</td>
<td><input type="text" id="UserName" runat=server/>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="UserPassword" runat=server/>
</td>
</table>
<input type="checkbox" id="PersistForms" runat=server />Use persistent cookie
<br>
<input type="submit" OnServerClick="SubmitBtn_Click" runat=server />
</form>
</body>
</html>
<html>
<head>
<script language="C#" runat=server>
void SubmitBtn_Click(Object Source, EventArgs E)
{
// Pull credentials from form fields and try to authenticate.
if (FormsAuthentication.Authenticate(UserName.Value,
UserPassword.Value))
{
FormsAuthenticationTicket ticket = new
FormsAuthenticationTicket(UserName.Value, false, 5000);
FormsAuthentication.RedirectFromLoginPage(UserName.Value,
PersistForms.Checked);
}
}
</script>
</head><body><form method=post runat=server>
<table>
<tr>
<td>Name:</td>
<td><input type="text" id="UserName" runat=server/>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="UserPassword" runat=server/>
</td>
</table>
<input type="checkbox" id="PersistForms" runat=server />Use persistent cookie
<br>
<input type="submit" OnServerClick="SubmitBtn_Click" runat=server />
</form>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货