开发者

ASP.NET User Control declaration in designer.cs file [duplicate]

开发者 https://www.devze.com 2022-12-13 22:24 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Why does ASP.NET auto-generated .designer code have the incorrect type?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Why does ASP.NET auto-generated .designer code have the incorrect type?

On my .aspx page, I have the following declaration to user my user control:

<%@ Register TagPrefix="uc" TagName="Produ开发者_如何学CctCategoryMenu" Src="~/Resources/Common/Controls/productCategoryMenu.ascx" %>

<uc:ProductCategoryMenu ID="ProductCategoryMenu" runat="server" />

Whenever the .designer file autogenerates, it declares

protected global::System.Web.UI.UserControl ProductCategoryMenu;

instead of the actual type of my user control. Is there a way I can change that so I don't always have to open the .designer.cs file and correct it? Thanks!!


Check this discussion out - I think it will solve your issue. It's about helping the application resolve the ~ correctly.


You're not supposed to manually edit the Designer file.


The easiest solution for you might be to remove the variable declaration from the MyPage.designer.cs into the MyPage.cs. It should normally not re-declare the variable into the MyPage.designer.cs.

Tell me if that fix your issue.

0

精彩评论

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

关注公众号