LdapAuthentication adAuth = new LdapAuthentication(adPath);
try
{
if(true == adAuth.IsAuthenticated(txtDomain.Text, txtUsername.Text, txtPassword.Text))
{
//You can redirect now.
Server.Transfer("~/WebForm2.aspx");
}
我想将登录页面移动到默认值(webform.2),但结果是执行〜/ WebForm2.aspx的子请求时出错。我写错了代码吗?或许我丢失了一些代码。
答案 0 :(得分:0)
尝试
$UTC = new DateTimeZone("UTC");
$newTZ = new DateTimeZone("America/New_York");
$date = new DateTime( "2011-01-01 15:00:00", $UTC );
$date->setTimezone( $newTZ );
echo $date->format('Y-m-d H:i:s');
echo "\n";
$interval = new DateInterval('P1D');
$date->sub($interval);
echo $date->format('Y-m-d H:i:s');
或者webform放在任何其他文件夹中。然后用完整的路径
Response.Redirect("WebForm2.aspx", false);