Reputation: 7203
When I drag and drop UpdatePanel on my user control I get this variable in the auto generated file of my user control:
/// <summary>
/// UpdatePanel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.UpdatePanel UpdatePanel1;
However, the UpdatePanel is found in a completely different namespace:
/// <summary>
/// UpdatePanel1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel UpdatePanel1;
I have this config entry in my web.config under the assemblies config section:
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
Why is this behavior happening to me?
Upvotes: 2
Views: 2196
Reputation: 148
1) Either reset the System.Web.UI.WebControls.WebParts.UpdatePanel
back to System.Web.UI.UpdatePanel
(same for ScriptManager) every time the ascx file is modified.. Recommended, but tedious.
2) I found that using a Register command at the top of the ASCX file seemed to properly override the default behavior of the designer to pick the 4.0 location for the 3.5 control (I think that is the underlying issue, it is a 4.0 designer backwards compatible with 3.5). Recommended, but be careful while adding controls with ASP:
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web"%>
...
<asp:ScriptManager runat="server" ID="smLocationsMap" />
3) You can include system.web.dll
, and system.web.design.dll
in your bin folder (Security/Other issues). Not recommended.
Upvotes: 4