开发者

User Controls Registered but cannot be accessed via code behind

I am finding it quite awkward. I have registered the user controls and they are actually being parsed as I can view the controls I have placed on them. Problem is that I cannot access them in code behing. Even when I p开发者_如何学JAVAlace them, their tags are not represented in the intellisence drop down. What could be causing this?

I am placing them on a page residing in a master page setting. The controls are declared on the child page.

The TagPrefix is not shown at all.


Kenyana check your designer file to make sure there is an entry for your control, if not open the page in designer view (not html) and it should update the designer file.


What VS version are you using? In VS 2008 it is a known issue, that intellisense might not work for usercontrols.

Check these Steps:
1) Make sure that the UserControl is without errors. Sometimes having bad markup prevents intellisense.
2) Rebuild your project. This might help

Nevertheless: The ability not to have intellisense does not prevent you from adding the control manually

<prefix:name ID="foo" runat="server"/>

Visual Studio 2010 much improves this situation. As of VS 2010 you will get access to intellisense for your usercontrols instantly (at least most of the time)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜