How to display server-side error message when user click any item in listview without posting or submitting webform asp.net
vb.net
Protected Sub ListView1_SelectedIndexChanging(sender As Object, e As ListViewSelectEventArgs)
If dr.HasRows Then
While dr.Read
End While
Else
here I want display the error code
End If
'
End Sub
<asp:ListView ID="ListView1" runat="server" DataKeyNames="GroupId"
OnSelectedIndexChanging="ListView1_SelectedIndexChanging">
<LayoutTemplate>
<table class="table" style="width: 75%" cellspacing="0" cellpadding="0" >
<tr style="background-color: #336699; color: White; border-bottom:solid; border-bottom-width:2px; border-bottom-color:black ">
</tr>
<tbody>
<asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr style="border-bottom:solid; border-bottom-width:2px">
<td style="width: 60px">
<asp:Button class="btn btn-default btn-lg btn-round" ID="lnkSelect" Text='<%# Eval("GroupId")%>' CommandName="Select" runat="server" Font-Size="X-Large"/>
</td>
<td style="font-family:'Trebuchet MS'; font-size:small; font-weight:bold"><%# Eval("GName")%> <br /> </td>
</tr>
</ItemTemplate>
<SelectedItemTemplate>
before issuing token it will check if it has taken or not, that will be doing by serverside code vb.net