Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i have a problem when i add second ajax control in a page which is already have one. i already embed toolkit script manager for creating a tab container.then in that tab panel i want to add one more control which is calender extender.

when i run the application the date is not insert into database.the textbox which is the target doesnt have the value.it is empty.so how can i do this?



thanks.
Posted
Comments
uspatel 23-Nov-11 2:56am    
Share code.
[no name] 23-Nov-11 3:20am    
Can you share us your script?

Hi,
I give you simple example working calender extender controls a single page.

Add AjaxControlToolkit control on web.config file.
HTML
<pages>
			<controls>
				<add tagprefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add tagprefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add tagprefix="ajax" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" />
				
			</controls>
		</pages>

Add Default.aspx

ASP.NET
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>Multiple Controls Ajax
    </title>
</head>
<body>
   <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        
        <table>
            <tr>
                <td>
                    Date1
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate1" runat="server">
                    <ajax:CalendarExtender ID="CalendarExtender1"  runat="server" TargetControlID="txtDate1"
                       CssClass="cal_Theme1" Format="dd-MMM-yyyy">
                    
                </td>
            </tr>
            <tr>
                <td>
                    Date2
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate2" runat="server">
                    <ajax:CalendarExtender ID="CalendarExtender2" TargetControlID="txtDate2" CssClass="cal_Theme1"
                         runat="server" Format="dd-MMM-yyyy">
                    
                </td>
            </tr>
            <tr>
                <td>
                    Date3
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate3" runat="server">
                    <ajax:CalendarExtender ID="CalendarExtender3"  runat="server" TargetControlID="txtDate3"
                        CssClass="cal_Theme1" Format="dd-MMM-yyyy">
                    
                </td>
            </tr>
            <tr>
                <td>
                    Date4
                </td>
                <td>
                    :
                </td>
                <td>
                    <asp:TextBox ID="txtDate4" runat="server">
                </td>
                <ajax:CalendarExtender ID="CalendarExtender4"  runat="server" TargetControlID="txtDate4"
                    CssClass="cal_Theme1" Format="dd-MMM-yyyy">
                
            </tr>
        </table>
    </div>
 </form>
</body>
</html>
 
Share this answer
 
v2
Comments
musiw 24-Nov-11 21:01pm    
TQ Jeetu :)
You just gave an example of how to add additional extenders to DIFFERENT controls. The questioner is asking about how to add multiple extenders to the SAME control.
 
Share this answer
 
Comments
André Kraak 30-Nov-12 9:52am    
If you have a question about or comment on a given solution use the "Have a Question or Comment?" option beneath the solution. When using this option the person who gave the solution gets an e-mail message and knows you placed a comment and can respond if he/she wants.

Please move the content of this solution to the solution you are commenting on and remove the solution.
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900