I am switching from VB to C# and facing a Problem for writing and calling function with in a form.
below is my code:
two textboxes which accepts value to be added and result in third textbox on button click event.
public int Add(int i, int j)
{
int result = i + j;
return result;
}
protected void btnResult_Click(object sender, EventArgs e)
{
int result = Add(tb1.Text, tb2.Text);
tb3.Text =(result);
}
But showing error invalid argument...
Plz help...

Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 26, 2013, 8:43 PM EDT
protected void btnResult_Click(object sender, EventArgs e)
{
int result = Add(Convert.ToInt32( tb1.Text),Convert.ToInt32( tb2.Text));
tb3.Text = result.ToString();
}
Aman Jen136 reputationPosted Aug 26, 2013, 8:58 PM EDT