---
title: "__doPostBack clears all text fields"  
description: "__doPostBack clears all text fields"  
author: "Anonymous User"  
published: 2014-11-20  
updated: 2014-11-21  
canonical: https://www.mindstick.com/forum/12653/__dopostback-clears-all-text-fields  
category: "asp.net"  
tags: ["asp.net", "jquery"]  
reading_time: 1 minute  

---

# __doPostBack clears all text fields

I want to call an [ASP.NET](https://www.mindstick.com/articles/934/default-folders-available-inside-the-asp-dot-net-application-folder) [code behind](https://www.mindstick.com/forum/2199/call-javascript-s-function-from-code-behind) [method](https://www.mindstick.com/forum/166/webservice-method) from JQuery and I use it by calling another [hidden](https://www.mindstick.com/forum/2303/skip-validating-field-from-hidden-div) [button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net) [OnClick](https://www.mindstick.com/forum/12718/onclick-for-hyperlink) attribute.

As you see I have to use __doPostBack [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) which clears all my [form](https://www.mindstick.com/forum/6/multi-form-mfc-application) inputs after code behind code is done.

Is there a way to prevent emptying my inputs?

Thanx in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

**ASPX:**

```
<asp:Button runat="server" ClientIDMode="Static" UniqueID="SubmitBTN" ID="SubmitBTN" OnClick="Submit_Click" Text="Submit" CssClass="DontShow" />button type="button" runat="server" onclick="submitfunc()" class="submit">Submit</button>
```

**JQuery:**

```
function submitfunc() {     __doPostBack('<%= SubmitBTN.UniqueID %>', '');}
```

## Replies

### Reply by Elena Glibart

try like this:

wrap your contents with Update Panels as Shown below or You can make Ajax Calls Using Jquery

```
 <asp:ScriptManager runat="server" ID="scriptManger1" />    <asp:UpdatePanel runat="server">        <ContentTemplate><asp:Button runat="server" ClientIDMode="Static" UniqueID="SubmitBTN" ID="SubmitBTN" OnClick="Submit_Click"
Text="Submit" CssClass="DontShow" /><button type="button" runat="server" onclick="submitfunc()"class="submit">Submit</button>  </ContentTemplate>    </asp:UpdatePanel>
```


---

Original Source: https://www.mindstick.com/forum/12653/__dopostback-clears-all-text-fields

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
