hi
I use bootstrap in a page and use the below codes to bind repeater from a database
There is a search button that when I click on it, will show data from the database into GridView
now problem is that when I select Item from repeaters and click on the search button it shows data in grid view correctly but it doesn't show my selected Item into repeater(drop-down list) it shows:
PLEASE SELECT ITEM
I want when I select an item from the repeater and click search button it shows my selected Item in the repeater after I click search button
<script type="text/javascript">
$(function () {
$(".dropdown-menu li a[id*=rptType]").click(function () {
$(this).closest('.dropdown').find(".btn:first-child").text($(this).text().trim());
$(this).closest('.dropdown').find(".btn:first-child").val($(this).text().trim());
$("[id*=hfSelectedType]").val($(this).text().trim());
});
$(".dropdown-menu li a[id*=Rmetraj]").click(function () {
$(this).closest('.dropdown').find(".btn:first-child").text($(this).text().trim());
$(this).closest('.dropdown').find(".btn:first-child").val($(this).text().trim());
$("[id*=hfSelectedMetraj]").val($(this).text().trim());
});
$(".dropdown-menu li a[id*=Rpttran]").click(function () {
$(this).closest('.dropdown').find(".btn:first-child").text($(this).text().trim());
$(this).closest('.dropdown').find(".btn:first-child").val($(this).text().trim());
$("[id*=hfSelectedTransfer]").val($(this).text().trim());
});
$('.dropdown-menu li a[id*=Rpttran]').click(function () {
$('#TH5L1L').show();
$('#TH5L1LPM2').hide();
$('#TH5L1LPMV').hide();
$('#TH5L1LPMPM').hide();
$('#TH5L1LPM11').show();
var Rpttran = $.trim($(this).html());
switch (Rpttran) {
case "فروش":
case "معاوضه":
case "پیش فروش":
$('#TH5L1L').hide();
$('#TH5L1LPMPM').hide();
$('#TH5L1LPMV').hide();
$('#TH5L1LPM11').show();
$('#Lablprice').show();
break;
case "رهن کامل":
case "رهن/اجاره":
case "اجاره":
$('#TH5L1LPM11').hide();
$('#TH5L1LPM2').show();
$('#TH5L1LPMPM').show();
$('#TH5L1LPMV').show();
break;
default:
}
});
});
</script>
<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;">
PLEASE SELECT ITEM
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<asp:Repeater ID="rptType" runat="server">
<ItemTemplate>
<li><a target="_blank" class="dropdown-item" ID="btnsystem" runat="server" CommandArgument='<%# Eval("type") %>'> <%# Eval("type") %></a></li>
</ItemTemplate>
</asp:Repeater>
and
if (!IsPostBack)
{
BindRepeater(rptType, "Estate_TY");
BindRepeater(Rpttran, "Estate_TRan");
BindRepeater(Rmetraj, "Estate_MEtrajI");
Best regards
Neda