I have an web project that uses Master Pages. I put the Toolkit Script Manager on the master page and the Script Proxy on the content page. I am using Calendar Extenders on the content pages. However, if I try to add a control (ie. label, textbox) after
adding the extenders the code-behind does not recognize the new control. I have another application that I have extenders on and I can add controls to the pages. The only difference I can see is the master/content pages. If I take the extenders off but
still have the script manager and proxy on the pages I can add controls that are recognized.
The message I receive when building is that <controlname> is not declared. The control is not listed in the dropdown control list on the code behind page.
bsummersgill
0 Points
4 Posts
Can't add controls to web page after adding Ajax extenders
Apr 03, 2012 08:11 PM|LINK
I have an web project that uses Master Pages. I put the Toolkit Script Manager on the master page and the Script Proxy on the content page. I am using Calendar Extenders on the content pages. However, if I try to add a control (ie. label, textbox) after adding the extenders the code-behind does not recognize the new control. I have another application that I have extenders on and I can add controls to the pages. The only difference I can see is the master/content pages. If I take the extenders off but still have the script manager and proxy on the pages I can add controls that are recognized.
rickjames961
Participant
775 Points
174 Posts
Re: Can't add controls to web page after adding Ajax extenders
Apr 03, 2012 08:39 PM|LINK
Please post the related code from your master and content pages. What error are you seeing when you try to add the control?
Friedrich Nietzsche
bsummersgill
0 Points
4 Posts
Re: Can't add controls to web page after adding Ajax extenders
Apr 04, 2012 02:14 PM|LINK
Content Page Heading
<%@ Page Language="vb" AutoEventWireup="false" MaintainScrollPositionOnPostback="true" MasterPageFile="~/Site2.Master" CodeBehind="WalkIn.aspx.vb" Inherits="IDATSTest.WalkIn" title="WalkIn" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc2" %>
<asp:Content ID="Content2" ContentPlaceHolderID="maincontent" runat="server">
<p>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
</p>
Master Page Heading
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site3.master.vb" Inherits="IDATSTest.Site3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Master2</title>
<meta name="IDATS" content="" />
<meta name="insurance" content="" />
<link href="style.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
The message I receive when building is that <controlname> is not declared. The control is not listed in the dropdown control list on the code behind page.
bsummersgill
0 Points
4 Posts
Re: Can't add controls to web page after adding Ajax extenders
Apr 04, 2012 02:17 PM|LINK
Here is the code for the calendar extender:
<tr>
<td align="right" height="35" style="WIDTH: 215px">Date Received:</td>
<td style="WIDTH: 397px; HEIGHT: 32px" align="left"><asp:textbox id="txtDateReceived" runat="server"></asp:textbox>
<cc2:CalendarExtender ID="txtDateReceived_CalendarExtender" runat="server"
cssclass="calendarContainer" Enabled="True" TargetControlID="txtDateReceived">
</cc2:CalendarExtender>
<asp:requiredfieldvalidator id="rfvRecdDate" runat="server" Font-Size="X-Small" ControlToValidate="txtDateReceived"
ErrorMessage="Enter date."></asp:requiredfieldvalidator>
<asp:comparevalidator id="Comparevalidator2" runat="server" Font-Size="X-Small"
ControlToValidate="txtDateReceived" ErrorMessage="Use MM/DD/YYYY format." Display="Dynamic" Operator="DataTypeCheck"
Type="Date"></asp:comparevalidator></td>
</tr>
If I remove the extender, I can add controls and they are recognized. And it's not just the calendar extender, it's any Ajax extender.
Song-Tian - ...
All-Star
43715 Points
4304 Posts
Microsoft
Re: Can't add controls to web page after adding Ajax extenders
Apr 05, 2012 07:37 AM|LINK
Hi,
Make sure you install the correct version of the AjaxControlToolkit:
Version 3.0.20229 2008-02-29 release of the AJAX Control Toolkit targets the official release of .NET Framework 3.5 and Visual Studio 2008.
Version 1.0.20229 You can also download the Toolkit for .NET Framework 2.0, ASP.NET AJAX 1.0 and Visual Studio 2005.
Version 3.0.40412
April 12, 2010 release of the AJAX Control Toolkit for ASP.NET 3.5 Service Pack 1 and Visual Studio 2008 SP1.
Version 4.1.51116.0
Nov 16 2011 release of the AJAX Control Toolkit for ASP.NET 4.0 and Visual Studio 2010
Then you could add the Ajax Control Toolkit to the VS Toolbox step by step at:http://www.asp.net/ajaxlibrary/act.ashx.
Feedback to us
Develop and promote your apps in Windows Store
bsummersgill
0 Points
4 Posts
Re: Can't add controls to web page after adding Ajax extenders
Apr 05, 2012 01:53 PM|LINK
Thanks. this was my problem. I had the wrong version of the toolkit for VS 2008 3.5.