我想要將.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
好的,非常感謝,我會盡力而爲 –