当前上下文中不存在名称“LinkButton4”??
错误提示:
当前上下文中不存在名称“LinkButton4”
行 17: protected void Page_Load(object sender, EventArgs e)
行 18: {
行 19: LinkButton4.Click += new EventHandler(DataList1_ItemCommand);//这一行是红色的
行 20: LinkButton5.Click += new EventHandler(DataList1_ItemCommand);}
.aspx部分代码
<asp:DataList ID= "DataList1 " runat= "server " Width= "275px " OnSelectedIndexChanged= "DataList1_SelectedIndexChanged " DataKeyField= "pro_id ">
<ItemTemplate>
<table style= "width: 174px ">
<tr>
<td style= "width: 70px "> <asp:Image ID= "Image3 " runat= "server " Width= "100px " Height= "100px " ImageUrl= ' <%# Eval( "photo ", "pic_{0}.bmp ") %> '> </asp:Image>
</td>
<td style= "width: 1987px "> 产品: <br>
单价: <br>
单位: <br>
<asp:LinkButton ID= "LinkButton4 " CommandName= "category " runat= "server " text= "类别信息 " /> <br>