Code:
Private Sub btnSaveAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveAdd.Click
Call AddJob()
If invalid Then
lblErrMsg.Text="Correct errors indicated below, then try again."
lblErrMsg.ForeColor = System.Drawing.Color.Red
lblErrMsg.Font.Bold = True
Exit Sub
End If
If blnLenError Then
MsgBox("Job Description cannot exceed 2000 characters.")
Exit Sub
Else
Call ClearForm()
ddState.SelectedItem.Text = "FL"
End If
End Sub
The above function is called when the user wants the job is added and the employer wants to add another. After the job is added, this function is called to clear the form and repost a clean & clear version of the AddJob.aspx
My problem is that after the user has selected Save & Go Back or Save & Add Another, the ClearForm , transfers the values of form fields to the values of the objects. After the form has cleared all the fields, the values are still located in the variables waiting to be added to the database. However, during the postback, the form comes back clear and the information stored in the form variables are cleared without being added to the database