Hi nedash,
Check this example. Now please take its reference and correct your code.
HTML
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="width: 190px !important;">
متراژ را انتخاب نمایید
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<asp:Repeater ID="Rmetraj" runat="server">
<ItemTemplate>
<li><a target="_blank" class="dropdown-item" id="btnsystem" runat="server" commandargument='<%# Eval("metraj") %>'>
<%# Eval("metraj") %></a></li>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
<br />
<asp:Label ID="TH5L1L" runat="server" Text="TH5L1L" /><br />
<asp:Label ID="TH5L1LA" runat="server" Text="TH5L1LA" /><br />
<asp:Label ID="TH5L1LP" runat="server" Text="TH5L1LP" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function () {
$('.dropdown-menu a').click(function () {
$('#TH5L1L').show();
$('#TH5L1LA').show();
$('#TH5L1LP').show();
var metraj = $.trim($(this).html());
switch (metraj) {
case "Sell":
case "Rent":
$('#TH5L1L').hide();
$('#TH5L1LA').hide();
break;
case "Buy":
$('#TH5L1LP').hide();
break;
default:
}
});
});
</script>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
System.Data.DataTable dt = new System.Data.DataTable();
dt.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("metraj") });
dt.Rows.Add("Sell");
dt.Rows.Add("Rent");
dt.Rows.Add("Buy");
Rmetraj.DataSource = dt;
Rmetraj.DataBind();
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Me.IsPostBack Then
Dim dt As System.Data.DataTable = New System.Data.DataTable()
dt.Columns.AddRange(New System.Data.DataColumn() {New System.Data.DataColumn("metraj")})
dt.Rows.Add("Sell")
dt.Rows.Add("Rent")
dt.Rows.Add("Buy")
Rmetraj.DataSource = dt
Rmetraj.DataBind()
End If
End Sub
Screenshot