How to use Ajax CalendarExtender using ModalPopupExtender?

Posted by prakashmondal5-21103 under ASP.NET on 5/17/2014 | Points: 10 | Views : 1041 | Status : [Member] | Replies : 3
I want to use Ajax CalendarExtender using ModalPopupExtender, but after click TextBox the Calender is shown but did not select any date.. The Calender will be enabled with false property.

Default.aspx (Sourcs Code):

I use Ajax DLL file that is AjaxControlToolkit.dll and also Registered.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="pm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<style type="text/css">
.style1 { width: 100%; }
.style2 { width: 100%; border: 1px solid #800000;}
.bgcolor {
width: 400px;
height: 180px;
margin: 30px 50px;
background-color: #ffffff;
border: 1px solid black;
opacity:0.6;
filter:alpha(opacity=60); /* For IE8 and earlier */
}
.bgcolor p { margin: 30px 40px; font-weight: bold; color: #000000; }
.style3 { color: #FF3300; font-weight: bold;}
.style4 { width: 208px; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="style1">
<tr>
<td class="style4">&nbsp;</td>
<td class="style3">Use of Ajax CalenderExtender with ModalPopupExtender</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style4">&nbsp;</td>
<td>
<asp:Button ID="Button2" runat="server" Text="Date" />
<pm:ModalPopupExtender ID="modal123" runat="server" TargetControlID="Button2" BackgroundCssClass="bgcolor" PopupControlID="Panel1" />
<pm:CalendarExtender ID="CCC" runat="server" Enabled="True" TargetControlID="TextBox1">
</pm:CalendarExtender>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style4">&nbsp;</td>
<td>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style4">&nbsp;</td>
<td colspan="2">
<asp:Panel ID="Panel1" runat="server" Width="400px">
<table class="style2">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Enter Date:</td>
<td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td><asp:Button ID="Button1" runat="server" Text="Next&gt;" /></td>
<td>&nbsp;</td>
</tr>
</table>
</asp:Panel>
</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style4">&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>





Responses

Posted by: Chandradev819 on: 5/19/2014 [Member] Starter | Points: 25

Up
0
Down
Hi

I checked your code. It is working fine on textbox click event. After that you can select the date from calender. What is your problem, what do you want do ? could you explain properly. so that we can help you.

Thanks and Regards
Chandradev
My Blog

prakashmondal5-21103, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: prakashmondal5-21103 on: 5/19/2014 [Member] Starter | Points: 25

Up
0
Down
Dear, Mr. Chandradev819
In this code, the Calender is shown on textbox click event but did not select any date.. The Calender will be enabled with false property.



prakashmondal5-21103, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Rimi1289 on: 5/20/2014 [Member] Starter | Points: 25

Up
0
Down
Its just an opinion. I think JQuery DatePicker is a better tool to work with. Since it is light weight and really easy to handle. This http://www.encodedna.com/2013/07/jquery-datepicker-change-focus-after-selection.htm explains everything you need.

prakashmondal5-21103, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response