0

I want to check if button is clicked in LoadViewState

Code:

protected override void LoadViewState(object savedState)
{
base.LoadViewState(savedState);

//Here If (btnAddExperience_Click()  is clicked)   
{
method1();
} 
//if(btnAddVisa_Click())
{
method2();
}
}

protected void btnAddExperience_Click(sender,e)
{
  //some code
}

protected void btnAddVisa_Click(sender,e)
{
  //some code
}

Any ideas?

Adel Khayata
  • 2,717
  • 10
  • 28
  • 46
user2500094
  • 1,033
  • 6
  • 23
  • 42

1 Answers1

0

this works in pageload you could try it in loadviewstate

if( IsPostBack ) 
{
    // get the target of the post-back, will be the name of the control
    // that issued the post-back
    string eTarget = Request.Params["__EVENTTARGET"].ToString();
}
ufosnowcat
  • 558
  • 2
  • 13