Hi nedash,
Refer below code.
HTML
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function () {
$(".dropdown-menu li a").click(function () {
$(this).closest('.dropdown').find(".btn:first-child").text($(this).text());
$(this).closest('.dropdown').find(".btn:first-child").val($(this).text());
});
});
</script>
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
واگذاری را انتخاب نمایید
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<asp:Repeater ID="rptTran" runat="server">
<ItemTemplate>
<li><a target="_blank" class="dropdown-item" id="btnsystem" runat="server" commandargument='<%# Eval("Transfer") %>'>
<%# Eval("Transfer") %></a></li>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
<br />
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="Button1" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Menu 2
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<li><a target="_blank" class="dropdown-item" id="btnsystem" runat="server" commandargument='<%# Eval("Transfer") %>'>
<%# Eval("Transfer") %></a></li>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
Code
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
System.Data.DataTable dt = new System.Data.DataTable();
dt.Columns.Add("Transfer");
dt.Rows.Add("Transfer 1");
dt.Rows.Add("Transfer 2");
dt.Rows.Add("Transfer 3");
dt.Rows.Add("Transfer 4");
rptTran.DataSource = dt;
rptTran.DataBind();
Repeater1.DataSource = dt;
Repeater1.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.Add("Transfer")
dt.Rows.Add("Transfer 1")
dt.Rows.Add("Transfer 2")
dt.Rows.Add("Transfer 3")
dt.Rows.Add("Transfer 4")
rptTran.DataSource = dt
rptTran.DataBind()
Repeater1.DataSource = dt
Repeater1.DataBind()
End If
End Sub
Screenshot