
how to clear all fields pls help me

how to clear all fields pls help me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal JoshiPosted Nov 4, 2022, 4:29 AM
Hello
There are several ways to clear form fiels.
One you can reload the page.
Another way you need to write custom function as shown in below code.
Rajeev KumarPosted Mar 14, 2023, 7:56 AM
If you want to clear all fields without any message then you can apply this code in button click event
protected void Button1_Click(object sender, EventArgs e)
{ Response.Redirect(Request.Url.AbsoluteUri); }
otherwise write it Response.Redirect(Request.Url.AbsoluteUri); after saving the data .
Brahma Prakash ShuklaPosted Nov 6, 2022, 7:03 AM
https://stackoverflow.com/questions/3794136/clear-all-fields-in-asp-net-form
Sachin SinghPosted Nov 4, 2022, 5:38 AM
better use javascript.
Amit MohantyPosted Nov 4, 2022, 4:33 AM
If you want clear all fields after save add below code.
Response.Redirect(Request.Url.AbsoluteUri);
If you want clear all fields on clear button click user below code.
Response.Redirect("~/YourPage.aspx", false);
Satya KarkiPosted Nov 4, 2022, 1:49 AM
You can try the option shown in the below blogs.
https://stackoverflow.com/questions/3794136/clear-all-fields-in-asp-net-form
https://dotprogramming.blogspot.com/2016/01/clear-all-form-fields-after-submit-data.html
Rijwan AnsariPosted Nov 4, 2022, 1:48 AM
You can write code to clear each field value or reload the page after save click.
Add below code after save.