Let the dynamically calling function be Btn_Click,then the ID of the clicked button can use as like the following;
protected void Btn_Click(object sender,EventArgs e)
{
//Assign the id to the string ButtonID
string ButtonID = ((Button)sender).ID.ToString( ) ;
//Set ID to Label1's Text property
Label1.Text = ButtonID.ToString( ) ;
}
protected void Btn_Click(object sender,EventArgs e)
{
//Assign the id to the string ButtonID
string ButtonID = ((Button)sender).ID.ToString( ) ;
//Set ID to Label1's Text property
Label1.Text = ButtonID.ToString( ) ;
}
Nice job..
ReplyDelete