2
Answers

How to check Button clicked in general methode?

dawood abbas

dawood abbas

9y
478
1
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)