mercredi 4 mars 2015

Insert webpart control disabled When my custom webpart control is added



I have created a visual web part that has ajax script manager, update panel and timer controls in visual studio 2010. When add this webpart to a Webparts Page it is working okay. But after I add this control to a normal page in sharepoint site as save it.I am unable to access 'Webpart' or 'Existing List' under the insert tab on clicking edit page as it appears grayed out.On hovering over the control it says.



"This control is currently disabled". You might not have the right permission level to use this,you might need to select an object or item or the control might not work.



This is my code HTML:



<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral,PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register TagPrefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages"
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DateTimeWebpartUserControl.ascx.cs"
Inherits="SharePointBranding.DateTimeWebpart.DateTimeWebpartUserControl" %>
<style type="text/css">
.style1
{
width: 350px;
border: 1px solid #000000;
}

</style>
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
</asp:ScriptManagerProxy>
<asp:Timer ID="tmrClock" runat="server" OnTick="Timer1_Tick" Interval="1000">
</asp:Timer>
<asp:UpdatePanel ID="pnlTimer" runat="server" Visible="True" >
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmrClock" EventName="Tick" />
</Triggers>
<ContentTemplate>
<table class="style1" width="">
<tr>
<td colspan="2">
<asp:Label ID="lblIST" runat="server" Text="Indian Time "
style="font-weight: 700"></asp:Label>
</td>
</tr>
<tr>
<td>
Delhi</td>
<td class="style2">
:&nbsp;<asp:Label ID="lblIST_Time" runat="server" Text="Label"> </asp:Label>
&nbsp; <asp:Label ID="lblTemp_Delhi" runat="server" Text="Label"> </asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblEST" runat="server" Text="Eastern Time " style="font-weight: 700"></asp:Label>
</td>
</tr>
<tr>
<td>
New York</td>
<td class="style2">
:
<asp:Label ID="lblEST_Time" runat="server" Text="Label"> </asp:Label>
&nbsp;<asp:Label ID="lblTemp_NY" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblPST" runat="server" Text="Pacific Time " style="font-weight: 700"></asp:Label>
</td>
</tr>
<tr>
<td>
Washington</td>
<td class="style2">
:&nbsp;<asp:Label ID="lblPST_Time" runat="server" Text="Label"> </asp:Label>
&nbsp;<asp:Label ID="lblTemp_Washington" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>

</ContentTemplate>
</asp:UpdatePanel>


Would it be something related to the update panel or timer. Because when i click edit page the following appears above the control and it goes when page is saved.



2200|updatePanel|ctl00_m_g_771df8a8_0dc5_4c38_80d3_867306406eb9_ctl00_pnlTimer|









0 commentaires:

Enregistrer un commentaire