Aniruddh Kewat

Aniruddh Kewat

  • NA
  • 30
  • 20.7k

Value of variable categoryid is not updated,when radiobutton

Jun 22 2015 9:29 AM
int categoryid = 0;
string brands = null;
int price = 0;
protected void Page_Load(object sender, EventArgs e)
{
//int categoryid = Convert.ToInt32((sender as LinkButton).CommandArgument);
if (!IsPostBack)
{
//dlCustomers.DataSource = GetCustomersData(pageindex,categoryid,brands,price);
dlCustomers.DataSource = GetCustomersData(1, categoryid, null, 0);
dlCustomers.DataBind();
}
}
protected void lbtnmenu_click(object sender, EventArgs e) { categoryid = Convert.ToInt32((sender as LinkButton).CommandArgument); Label1.Text = "CategoryId : " + categoryid;
if (rblpricerange.Items.Cast<ListItem>().Any(x => x.Selected)) { price = Convert.ToInt32(rblpricerange.SelectedValue); } //dlCustomers.DataSource = GetCustomersData(pageindex,categoryid,brands,price); dlCustomers.DataSource = GetCustomersData(1, categoryid, brands, price); dlCustomers.DataBind();
Getbrands(categoryid); foreach(ListItem li in rblpricerange.Items) { if(li.Selected) { li.Selected = false; } } }
protected void rblpricerange_SelectedIndexChanged(object sender, EventArgs e)
{
if (rblbrands.Items.Cast<ListItem>().Any(x => x.Selected))
{
brands = rblbrands.SelectedItem.Text;
}
int price = Convert.ToInt32(rblpricerange.SelectedValue);
//dlCustomers.DataSource = GetCustomersData(pageindex,categoryid,brands,price);
dlCustomers.DataSource = GetCustomersData(1, categoryid, brands, price);
dlCustomers.DataBind();
Label2.Text = " CategoryId : " + categoryid + " ,rbtnpricerange : " + rblpricerange.SelectedValue;
}