Thursday, July 9, 2009

One Textbox assign Multible Button value

i have created 10 Buttons. when i click 5th button the textbox value must be in 5.
this code will help...
in Design part Button Event Click event give btnTickets_Click

Web Application:
protected void lnkShowDate_Click(object sender, EventArgs e)
{
string str = ((System.Web.UI.WebControls.LinkButton)(sender)).ToolTip;
}

Windows:
private void btnTickets_Click(object sender, EventArgs e)
{
txtTicket.Text = ((System.Windows.Forms.ButtonBase)(sender)).Text;
}

No comments: