mannevenu26
asked on
ASP.NET with C#
I am trying insert values into data base.using ASP.Net(C#).
Emp Name: Textbox (validation ontrol Required field)
Emp Id : TextBox
Country : Text box
Submit Button
* After successfull insertion i want to display it in label like "Successfully Inserted".
Up to here No issues. I am able to do.
Now again i removed text box value.click it on submit.Validation is coming fine.But "Successfully Inserted message " still there.
I want to clear of this message when i click second time sumbit button if any validation happens.
Emp Name: Textbox (validation ontrol Required field)
Emp Id : TextBox
Country : Text box
Submit Button
* After successfull insertion i want to display it in label like "Successfully Inserted".
Up to here No issues. I am able to do.
Now again i removed text box value.click it on submit.Validation is coming fine.But "Successfully Inserted message " still there.
I want to clear of this message when i click second time sumbit button if any validation happens.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Write below code in button click event.
button1_Click()
{
Label1.Text = "";
//OR
Label1.Text = string.Empty;
//Remaining code
}
button1_Click()
{
Label1.Text = "";
//OR
Label1.Text = string.Empty;
//Remaining code
}
Write below code in button click event.
button1_Click()
{
{
//code for Insert
}
Label1.Text = string.Empty;
//Remaining code
}
In button click event check for the page is valid or not and then make the insert statement to get executed
Open in new window