2011-03-07 81 views
0

因此,我在我的aspx頁面上有一個鏈接,我試圖使用lightbox觸發單獨的html。每當我點擊鏈接的燈箱工作正常,但正在加載的HTML給我下面的錯誤。但如果我使用的是一個aspx文件,而不是一個HTML文件,它的工作原理但它顯示了兩次頁面!我搜索了,我不知道如果編輯aspnet_isapi.dll將真的工作。首先,我甚至不知道在哪裏可以找到它。有什麼想法嗎? 謝謝!用於訪問路徑'/'的HTTP動詞POST不允許在HTML頁面上

The HTTP verb POST used to access path '/test.html' is not allowed. 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: The HTTP verb POST used to access path '/PersonEditor_WebApp/test.html' is not allowed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

** * ** * ****編輯代碼* ** * ** * ** * * * * **

<tr> 
    <td><asp:Button ID="bLogin" runat="server" Text="Login" onclick="bLogin_Click" /></td> 
    <td><asp:LinkButton ID="lbForgotPassword" runat="server" href="confirmcancel.html" autopostback="true" OnClick="lbForgotPassword_OnClick">Forgot Password</asp:LinkButton></td> 
    <td><asp:Label ID="lbLoginError" runat="server" ForeColor="Red" 
      CssClass="validator"></asp:Label></td> 

</tr> 

** * ** *這是對CS文件* ** * ** * ** *的一個** *

protected void Page_Load(object sender, EventArgs e) 
{ 
    Page.MaintainScrollPositionOnPostBack = true; 
    //register javascripts and setup buttons 
    ClientScript.RegisterClientScriptBlock(this.GetType(), "Prototype", "<script src='Scripts/prototype.js' language=javascript></script>"); 
    ClientScript.RegisterClientScriptBlock(this.GetType(), "LigthBoxScript", "<script src='Scripts/lightbox.js'></script>"); 
    lbForgotPassword.CssClass = "lbOn"; 


} 
+0

您是否記得在打開燈箱時阻止鏈接動作?如果沒有,您將加載lightbox並且鏈接將使瀏覽器進入鏈接指向的任何頁面。 – 2011-03-07 15:51:33

+0

你是什麼意思阻止鏈接操作? – gdubs 2011-03-07 16:06:57

+0

我們需要更多信息。請發佈源代碼。 – Chev 2011-03-07 19:58:54

回答

0

Ok s o我想我解決了它。但不是真的。

我能夠使燈箱載入正確的頁面,但它需要是一個aspx頁面。如果我使用正常的HTML頁面,我再次得到錯誤...

而我用同樣的代碼行btw。 所以我想我只需要做一個aspx頁面。 如果有人會知道爲什麼常規的HTML頁面會給出錯誤,請隨時發佈答案。

非常感謝! -G

相關問題