【发布时间】:2012-08-20 14:18:18
【问题描述】:
我遇到以下错误:
'DirectActivity' does not contain a definition for 'ddl_jobcode_Id2' and no extension method 'ddl_jobcode_Id2' accepting a first argument of type 'DirectActivity' could be found (are you missing a using directive or an assembly reference?)
在我的 aspx 中,我创建了这样的 DropDownList:
<asp:DropDownList ID="ddl_jobcode_Id2" runat="server" DataSourceID="ddl_ActivityType2"
DataTextField="jobCode" DataValueField="ID" SelectedValue='<%# Bind("jobCode_ID2", "{0}") %>'
OnDataBound="ddl_jobcode_Id2_DataBound"
onselectedindexchanged="ddl_jobcode_Id2_SelectedIndexChanged1"
AutoPostBack="True">
</asp:DropDownList>
我需要添加一个控件,以便在 .cs 文件中写入
protected void ddl_jobcode_Id2_SelectedIndexChanged1(object sender, EventArgs e)
{
if(this.ddl_jobcode_Id2.SelectedValue == "19" )
{ ...}}
它只是在ddl_jobcode_Id2 上显示此错误
有人可以帮帮我吗?非常感谢!!!
【问题讨论】:
-
您是否更改了页面指令部分(您的 .aspx 文件的第一行)的类?