2016-06-10 65 views
0
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的子请求。我写错码了吗?或者我可能丢失了一些代码。如何使用Autentication将页面引导到ASP.NET中的另一个页面

回答

0

尝试

Response.Redirect("WebForm2.aspx", false); 

,或者如果网络表单被放置在任何其他文件夹。然后用完整路径

Response.Redirect("~/pages/WebForm2.aspx", false); 
+0

仍然执行〜/ WebForm2.aspx的子请求时出错。 –

+0

如果我不添加

到html正文页面的网站运行,但是当我添加该网站无法运行。 –

+0

你能发布你正在得到的确切的错误吗? – rahlrokks

相关问题