开发者

Problem With Custom Control on Page Using a MasterPage

I have a content page which has a related master page. I register a prefix <%@ TagPrefix 开发者_StackOverflow中文版..... and can load other custom controls at that namespace. However, one particualar control at the same namespace, when added to the aspx page, breaks it. The control in question inherits from asp:Panel, has a parameterless constructor, defines a few public accessors, and creates some standard child controls, and nothing much else.

Are there some fundamental restrictions to creating custom asp controls that I am breaking unknowingly?


Add the control back to the page. Delete the designer file for the page: .aspx.designer.cs

Then right click on the page and select Convert to Web Application. This should give you the actual error the page has when attempting to write the control definition to your designer file.

I suspect there is a compilation error in your custom control.


My control was attempting to access Page.Header which was null as the master page had not marked the tag with runat="server".

I guess that is a fundamental restriction that I was looking for...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜