我使用Facebook的評論和喜歡的盒子,他們的工作,但像按鈕沒有工作。當我想添加sublayout我採取「錯誤發生」的消息。我查了日誌,異常消息是Facebook Like按鈕的Sitecore
Exception: System.InvalidOperationException
Message: Attempt to write to read-only property: Font. Declaring type: System.Web.UI.WebControls.WebControl
Source: Sitecore.Kernel
at Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, PropertyInfo property, Object value)
at Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, String name, Object value)
at Sitecore.Data.Items.RenderingItem.SetParameters(Object control, String parameters)
at Sitecore.Data.Items.RenderingItem.GetControl(RenderingSettings settings, XmlNode controlNode)
at Sitecore.Layouts.RenderingReference.GetControl()
at Sitecore.Nexus.Web.NexusPlaceholderApi.(Placeholder placeholder)
at Sitecore.Nexus.Web.NexusPlaceholderApi.CreateChildControls(Placeholder placeholder)
at System.Web.UI.Control.EnsureChildControls()
at Sitecore.Layouts.PageContext.Expander.Expand(Control control)
at Sitecore.Layouts.PageContext.Expander.Expand(Control control)
at Sitecore.Web.UI.WebControls.Sublayout.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at Sitecore.Layouts.PageContext.Expander.Expand(Control control)
at Sitecore.Nexus.Web.NexusPlaceholderApi.(Placeholder placeholder)
at Sitecore.Nexus.Web.NexusPlaceholderApi.CreateChildControls(Placeholder placeholder)
at System.Web.UI.Control.EnsureChildControls()
at Sitecore.Layouts.PageContext.Expander.Expand(Control control)
at Sitecore.Layouts.PageContext.Expander.Expand(Control control)
at Sitecore.Layouts.PageContext.Expander.Expand(Control control)
at Sitecore.Layouts.PageContext.Build()
at (Object , Object[])
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Layouts.PageContext.BuildControlTree(Object sender, EventArgs e)
at System.Web.UI.Page.PerformPreInit()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Like按鈕具有字體和我刪除了它,但我得到了同樣的錯誤。誰能幫我
它在sublayout,Sublayout
ascx side;
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<asp:Literal runat="server" ID="fbLikeButton"></asp:Literal>
ascx.cs side;
Sublayout slb = (Sublayout)this.Parent;
System.Collections.Specialized.NameValueCollection parameters = Sitecore.Web.WebUtil.ParseUrlParameters(slb.Parameters);
fbLikeButton.Text = "<fb:like href=\"";
fbLikeButton.Text += parameters["Url"];
fbLikeButton.Text += "\" send=\"true";
fbLikeButton.Text += "\" width=\"";
fbLikeButton.Text += parameters["Width"];
fbLikeButton.Text += "\" show_faces=\"true";
fbLikeButton.Text += "\" action=\"like";
//fbLikeButton.Text += "\" font=\"";
//fbLikeButton.Text += parameters["Font"];
fbLikeButton.Text += "\"></fb:like>";
請發佈Like按鈕的代碼。它是在WebControl,Sublayout,XSLT還是直接在佈局中? –