dawood abbas

dawood abbas

  • NA
  • 56
  • 4.8k

How to check Button clicked in general methode?

Apr 20 2015 2:25 AM
I have tried with below
 
public partial class PaymentSearch : System.Web.UI.Page
{
   private bool button1WasClicked = false;
   
   
   protected void linkToday_Click(object sender, EventArgs e)
   {
      button1WasClicked = true;
    }
    
  protected void ddlRecordPayment_SelectedIndexChanged(object sender, EventArgs e)
  {
  gridAllPaymentBind(1);
  }
   public void gridAllPaymentBind(int pageIndex)
   {
   if (button1WasClicked == true)
  {
   result = 3;
    command.Parameters.AddWithValue("@result", result);
   }
 
 }
 
but in 'gridAllPaymentBind' methode ' button1WasClicked'  getting false value where I alredy clicked link button before dropdown list change event fire.

Answers (2)