我想要将.net网页与.net网页表单集成。 我刚才复制.PHP网页,并粘贴到.NET Web应用程序试图打开.php页面时点击asp按钮
这里是.NET代码:
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
和代码背后,是
protected void Button1_Click(object sender, EventArgs e)
{
Server.Transfer("register.php");
}
但它给给定一个异常低于
Server Error in '/' Application. No http handler was found for request type 'POST'
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: No http handler was found for request type 'POST'
Source Error:
Line 17: protected void Button1_Click(object sender, EventArgs e) Line 18: { Line 19:
Server.Transfer("register.php"); Line 20: Line 21:
}Source File: c:\Users\Vishal\Documents\Visual Studio 2013\Projects\TestHomePage\test3\WebForm2.aspx.cs Line: 19
Stack Trace:
[HttpException (0x80004005): No http handler was found for request type 'POST']
System.Web.HttpApplication.MapIntegratedHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig, Boolean convertNativeStaticFileModule) +898
System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm) +464[HttpException (0x80004005): Error executing child request for register.php.]
但这两个项目在相同的解决方案,但在不同的应用程序,每当我使用上面的方法,那么“页面找不到”错误出现。 –
我给了文件名作为一个简单的例子,但如果它不在网站的同一个文件夹中,您需要提供更具体的路径或完整的URL。找不到页面就意味着PHP文件不在您指定的位置。我不知道你的IIS结构究竟在哪里,所以你需要解决这个问题。但原则是一样的。 – ADyson
好的,非常感谢,我会尽力而为 –