Forcing a Partial Postback from JavaScript
In this situation, you would like to cause a postback, notifying the server of a change in a hidden fields contents.
function PartialPB(someValue)
{
var hidden = document.getElementById(hiddenClientId);
hidden.value = someValue;
__doPostBack('<%= TaskUpdatePanel.ClientID %>', '');
}
Wrap the hidden field in an update panel (TaskUpdatePanel in this case):
<asp:UpdatePanel ID="TaskUpdatePanel" runat="server" UpdateMode="Always"><ContentTemplate>
<asp:HiddenField ID="sampleHiddenField" runat="server" Value="" />
</ContentTemplate></asp:UpdatePanel>
This should work. The important part is the UpdatePanel ID as the first argument in the __doPostBack(). This will set the target to be the UpdatePanel, and cause a Partial Postback rather than a full.