title: How can I show a success messsage with erasing the entered data from the form?
body: <p>I am a new ASP.NET developer and I have the following simple Data Entry Form that will be used for inserting the required informaiton to the database. My question is after clicking the insert button, I want to keep the user in the same page with getting a message about the status of insertion and with removing the data from the data entry fields. So how to do that?</p>
  
  <p>For example, I have the following form and what I want is when the user clicks on Submit button and after inserting the data into database, I want to show him a Success message without keeping the data he entered in the fields. They should be removed and ready for another data insertion. </p>
  
  <p><strong>So how to do that?</strong></p>
  
  <p>ASP.NET code:</p>
  
  <pre><code>&lt;asp:Panel ID="Panel1" runat="server"&gt;
          &lt;h3&gt;Adding a New Item&lt;/h3&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Name: &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="txtName" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Description: &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="txtDesc" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Start Date: &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="txtStartDate" runat="server"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtStartDate"&gt;&lt;/asp:CalendarExtender&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;End Date: &lt;/td&gt;
                  &lt;td&gt;
                      &lt;asp:TextBox ID="txtEndDate" runat="server"&gt;&lt;/asp:TextBox&gt;
                      &lt;asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtEndDate"&gt;&lt;/asp:CalendarExtender&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" /&gt;
          &lt;br /&gt;
          &lt;asp:Label ID="lblMessage" runat="server" Text=""&gt;&lt;/asp:Label&gt;
      &lt;/asp:Panel&gt;
  </code></pre>