English 中文(简体)
Asp.net jquery发布ascx:这种类型的页面不是
原标题:
  • 时间:2009-05-17 10:03:43
  •  标签:

When I m trying to call an ascx with Jquery post I get: "This type of page is not served" I think it s something to do with the IIS not allowing calls directly to ascx. Is it possible to allow posting to ascx? I have IIS6. Thanks.

最佳回答

不是,.ascx是一个控件,它被包含并渲染在.aspx页面中。

So the error is correct, ascx should not be served.

Wrap it in an aspx page like so:

<%@ Page %>
<%@ Register TagPrefix="scott" TagName="header" Src="Controls/Header.ascx" %>
<scott:Header runat=server id="control1" />
问题回答

Just FYI, in an MVC application, you are actually allowed to load an .ascx by pointing the URL to an Action that returns a PartialView.





相关问题
热门标签