RSS

jquery calendar not working in updatepanel

31 Jul

JQuery Calaner

 
<link rel=”stylesheet” href=”http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css&#8221; />
<script src=”http://code.jquery.com/jquery-1.9.1.js”></script&gt;
<script src=”http://code.jquery.com/ui/1.10.3/jquery-ui.js”></script&gt;
<link rel=”stylesheet” href=”/resources/demos/style.css” />

<script>
$(function () {
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
$(“#ctl00_ContentPlaceHolder1_pspSalePrice_txtstDate”).datepicker({ minDate: 0 });
});

});

</script>

 
<asp:UpdatePanel ID=”UpdatePanel25″ runat=”server” UpdateMode=”Conditional” RenderMode=”Inline”>
<ContentTemplate>

<table>

<tr id=”trDate” runat=”server” height=”10″>
<td >
</td>
<td align=”right”>
<asp:Label ID=”lblDate” runat=”server” Text=”Start Date” CssClass=”Label”></asp:Label>&nbsp;
</td>
<td align=”left”>
<asp:TextBox ID=”txtstDate” runat=”server” MaxLength=”10″  ></asp:TextBox>

<asp:RequiredFieldValidator ID=”rfvDate” runat=”server”
ControlToValidate=”txtstDate” ErrorMessage=”Please enter a Date.”
ToolTip=”Please enter a Date.” ValidationGroup=”AddEditPromotionalSalePrices” Enabled=”true” >*</asp:RequiredFieldValidator>

</td>
<td >
</td>
</tr>

</table>

</ContentTemplate>
</asp:UpdatePanel>

 

Solution:

i face this issue when i create usercontrol and use on Webpage.

with Above code  Jquery Calander on woriking first time after postback calander not working . so fine solution of this problem just change in header section jquery code replace with below mention code.

 


<script type="text/javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function(evt, args) {
        $(".datepicker").datepicker();
    });
</script>

dtpicker
Advertisements
 
Leave a comment

Posted by on July 31, 2013 in JQuery

 

Tags: , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: