2011-03-07 109 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

相关问题