Problem with datepicker while setting its initial value

Problem with datepicker while setting its initial value

Hi,
I am using datepicker in my page for user's date of birth. It is working fine when user first time enters his/her date of birth. But when he want to update date of birth then datepicker doesn't set its initial value. But It can set another date when user selects date. It doesn't show previous selected date.
My datepicker is inside an Update Panel. below is code the which I am using.

Because My datepicket is inside update panel, that's why I have used function & then I have registered this function. So that jqiery will also work after updating the panel.
For Creating the datepicker control:
function BindJQueryControls() { 
$('#DateOfBirth').datepicker({
altField: '#<%# txtDateOfBirth.ClientID %>',
altFormat: "mm/dd/yy",
changeMonth: true,
changeYear: true,
showOtherMonths: true,
selectOtherMonths: true });
$('#DateOfBirth').datepicker("option""showAnim""blind");
}









I have placed below script inside my update panel:
<script type="text/javascript">  
if
 (typeof BindJQueryControls== 'function')
Sys.Application.add_load(BindJQueryControls);  </script>
Above Code is working fine when User select date.
At the time of update, I am using below script from Code behind to set datepicker's value.

string strDOBScript = @"$(function () { $('#DateOfBirth').datepicker(""setDate"", """ + strDateOfBirth@""");});";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "insexdt", strDOBScript , true);

I have also tried hard coded data at the end of page:

$('#DateOfBirth').datepicker("setDate""01/12/2013");
But doesn't work.

If I place above code in a separate page without update panel, it is working smoothly.

Can someone please tell me where I am doing wrong?

--
Anuj Rathi