after entering date into the textbox user must follow these steps protected void Button1_Click(object sender, EventArgs e) { code } then protected void Button2_Click(object sender, EventArgs e) { code } protected void Button1_Click(object sender, EventArgs e) { code }