Harish Batchu

Harish Batchu

  • NA
  • 255
  • 71k

Listbox onselectindex event is not firing?

Oct 14 2018 9:47 PM
<ul role="tablist" class="nav nav-tabs ver-nav-tab" id="myTabs_8">
<li class="active" role="presentation"><a aria-expanded="true" data-toggle="tab" role="tab" id="home_tab_8" href="#home_8">ALL</a></li>
<li role="presentation" class=""><a data-toggle="tab" id="profile_tab_8" role="tab" href="#profile_8" aria-expanded="false">Reports</a></li>
<li class="dropdown" role="presentation">
<a data-toggle="dropdown" class="dropdown-toggle" id="myTabDrop_8" href="#" aria-expanded="false">Month Wise <span class="caret"></span></a>
<asp:ListBox ID="ListMenu" runat="server" class="dropdown-menu" OnSelectedIndexChanged="GetByMonth" >
<asp:ListItem Value="04">APR</asp:ListItem>
<asp:ListItem Value="05">MAY</asp:ListItem>
<asp:ListItem Value="06">JUN</asp:ListItem>
<asp:ListItem Value="07">JUL</asp:ListItem>
<asp:ListItem Value="08">AUG</asp:ListItem>
<asp:ListItem Value="09">SEP</asp:ListItem>
<asp:ListItem Value="10">OCT</asp:ListItem>
<asp:ListItem Value="11">NOV</asp:ListItem>
<asp:ListItem Value="12">DEC</asp:ListItem>
<asp:ListItem Value="01">JAN</asp:ListItem>
<asp:ListItem Value="02">FEB</asp:ListItem>
<asp:ListItem Value="03">MAR</asp:ListItem>
</asp:ListBox>
</li>
</ul>
protected void GetByMonth(object sender, EventArgs e)
{
con = getcon.GetConnection();
int s = ListMenu.SelectedIndex;
cmd = new SqlCommand("select IncomeType,UserIncomeDetail_Amount from ft_UserIncomeDetail inner join Dim_IncomeType on ft_UserIncomeDetail.IncomeType_Id=Dim_IncomeType.IncomeType_id where MONTH(UserIncomeDetail_Date) = '" + s + "' and ft_UserIncomeDetail.User_Uniq='150883940'",con);
cmd.CommandType = CommandType.Text;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);
Gridview_Bymonth.DataSource = ds;
Gridview_Bymonth.DataBind();
con.Close();
}

Answers (1)