本文介绍了不能用的ClientIDMode,指出缺少的程序集引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在生成错误是:

'System.Web.UI.WebControls.DropDownList'不包含'的ClientIDMode',没有扩展方法的ClientIDMode接受式的第一个参数'System.Web.UI.WebControls的定义.DropDownList'可以找到(是否缺少using指令或程序集引用?)

在code是:

<asp:DropDownList ID="cbNames" ClientIDMode="Static" runat="server"> 
    <asp:ListItem Value="" Text="&lt;--Select Name--&gt;" /> 
    <asp:ListItem Value="0" Text="Name1" /> 
    <asp:ListItem Value="1" Text="Name2" /> 
</asp:DropDownList>

我使用的.NET framework 4.0作为构建框架。

I am using .NET framework 4.0 as the build framework.

有没有变化,我会需要,以使.NET承认属性,使web.config文件?

Is there a change to the web.config file that I'd need to make in order to enable .NET to recognise the attribute?

推荐答案

我不,你实际上是使用4.0框架的想法。右键单击该项目,并转到属性。看看目标框架存在,并且切换到4.0或4.5

I don't think you are actually using the 4.0 framework. Right click on the project and go to properties. Look at the target framework there and switch it to 4.0 or 4.5

这篇关于不能用的ClientIDMode,指出缺少的程序集引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 02:48