我有用户控件,它在项目模板中有linkbutton,我试图在代码后面捕获Itemcommand事件,但事件没有被解雇。ListView中的ItemCommand未在用户控件中触发
我已经通过了其他类似的问题,但它没有帮助我。下面是我的代码片断,有谁能帮我解决这个问题吗?
Listview-
<asp:ListView runat="server" ID="lvTherapeuticAlternatives" OnItemCommand="TherapeuticAlternatives_OnItemCommand">
ItemTemplate-
<ItemTemplate>
<tr class='data'>
<td style="width:210px;">
<asp:LinkButton ID="lnkMedSelection" runat="server" CommandName="SelectedMed" CommandArgument='<%#Eval("NDC") & ", " & Eval("DrugGenericProductID") %>' >
<asp:Label ID="lblDrugName" runat="server" Text='<%# Eval("DrugDescription") %>' />
</asp:LinkButton >
</td>
<td style="width:70px;" align="center">
<asp:Label ID="lblBrandGeneric" runat="server" Text='<%# Eval("descBrandGeneric") %>' />
</td>
<td style="width:110px;" align="center">
<asp:Label ID="lblStatus" runat="server" Text='<%# Eval("FormularyStatusDescription") %>' />
</td>
<td style="width:210px;" align="left">
<asp:Label ID="lblFlat" runat="server" Text='<%# Eval("CopayInfo") %>' />
</td>
</tr>
</ItemTemplate>
Codebehind-
Protected Sub TherapeuticAlternatives_OnItemCommand(ByVal sender As Object, ByVal e As ListViewCommandEventArgs) Handles lvTherapeuticAlternatives.ItemCommand
End Sub
感谢您的评论。 – Senthil
我在列表视图控件中有链接按钮。它是 - asp:LinkButton ID =“lnkMedSelection”runat =“server”CommandName =“SelectedMed”CommandArgument ='<%#Eval(“NDC”)&“,”&Eval(“DrugGenericProductID”)%>' – Senthil
@Senthil没问题,但是这对你有帮助吗?你知道你需要做什么才能解决这个事件吗? – Icarus