When the user clicks the reset button I want to clear all form elements. It doesn't work...any thoughts?
Here's the C# code:
Here's the C# code:
Code:
protected void btnReset_Click(object sender, EventArgs e)
{
txtSupplier.Text = "";
txtPmtType.Text = "";
txtFromDate.Text = "";
txtToDate.Text = "";
txtFromDlrAmt.Text = "";
txtToDlrAmt.Text = "";
ddlOpUnit.SelectedValue = "";
if (rblPmtType.SelectedItem != null)
{
rblPmtType.SelectedItem.Selected = false;
}
if (rblInvMthd.SelectedItem != null)
{
rblInvMthd.SelectedItem.Selected = false;
}
if (rblPmtStatus.SelectedItem != null)
{
rblPmtStatus.SelectedItem.Selected = false;
}
if (rblInvPmtDate.SelectedItem != null)
{
rblInvPmtDate.SelectedItem.Selected = false;
}
if (rblDlrAmts.SelectedItem != null)
{
rblDlrAmts.SelectedItem.Selected = false;
}
}