hi
I use a repeater to bind data in the dropdown list below is code:
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
select item
</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>
now I want to send repeater's selected item as a parameter to store procedure below are codes
private void GetEstatInfo(int pageIndex)
{
using (SqlConnection conn = General.GetConnection())
{
using (SqlCommand cmd = General.GetCommand("Estate_Information", conn))
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@PageIndex", pageIndex);
cmd.Parameters.AddWithValue("@PageSize", PageSize);
cmd.Parameters.AddWithValue("@Year", Lblforosh2.Text);
cmd.Parameters.AddWithValue("@Type",??????????);
cmd.Parameters.Add("@RecordCount", SqlDbType.Int, 4);
cmd.Parameters["@RecordCount"].Direction = ParameterDirection.Output;
conn.Open();
SqlDataReader idr = cmd.ExecuteReader();
if (idr.HasRows)
{
GrdAmlak.DataSource = idr;
GrdAmlak.DataBind();
}
else
{
GrdAmlak.DataSource = idr;
GrdAmlak.DataBind();
}
idr.Close();
this.PopulatePagerP(Convert.ToInt32(cmd.Parameters["@RecordCount"].Value), pageIndex);
}
}
}
here in below line:
cmd.Parameters.AddWithValue("@Type",??????????);
I want to send the selected item from repeater to @Type
how I can do it?
Best regards
Neda