简体   繁体   English

将内容编辑器Web部件添加到sharepoint 2010用户控件

[英]Add content editor web part to a sharepoint 2010 user control

What's the best way to add a content editor web part into a user control? 将内容编辑器Web部件添加到用户控件中的最佳方法是什么?

I have created the user control with basic HTML just to get it to show some content. 我已经使用基本HTML创建了用户控件,只是为了使其显示一些内容。 I have updated the master page to include the user control and so far the control is loaded correctly into the master page and I can see the sample HTML content/message I have added into the user control. 我已经更新了母版页以包括用户控件,到目前为止,该控件已正确加载到母版页中,并且可以看到我添加到用户控件中的示例HTML内容/消息。

How do I then add a content editor web part into the user control? 然后,如何将内容编辑器Web部件添加到用户控件中?

I have created a test content editor and have exported it which gives me the DWP file. 我创建了一个测试内容编辑器,并导出了它,这给了我DWP文件。 I can see then HTML inside the DWP file what the best way to them add this into the user control mentioned above? 我可以看到DWP文件中的HTML是什么最好的方式将它们添加到上述用户控件中?

Hopefully this is simpler to do than how I am describing it... 希望这比我描述的方法更简单...

Thanks in advance for any suggestion 预先感谢您的任何建议

I found a better way to do this.. 我找到了一种更好的方法。

Essentially I just created a user control and referenced it from the master page in the footer section. 本质上,我只是创建了一个用户控件,并在页脚部分的母版页中引用了它。

In the code behind for the user control I am reading a html file stored in the Style Library and spit out onto the page via a content place holder 在用户控件后面的代码中,我正在读取存储在样式库中的html文件,并通过内容占位符吐出到页面上

This works great and it allows for the content to the updated simply by updating the html file stored in the Style library 这很好用,并且只需更新存储在样式库中的html文件,就可以更新内容

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Sharepoint 2010中扩展OOTB内容编辑器Web部件? - How can I extend the OOTB Content Editor Web Part in Sharepoint 2010? 有什么方法可以将用户控件中的对象代码用作Sharepoint 2010 Web部件中新对象的模板? - Any way to use object code in a User Control as a template for a new Object in a Sharepoint 2010 web part? 如何在Sharepoint 2013中调整/扩展内容编辑器Web部件 - How to adjust/extend the Content Editor Web Part in Sharepoint 2013 将内容编辑器Web部件添加到母版页SP2010 - Adding a content editor web part to master page SP2010 在SharePoint 2010 Web部件中模拟用户以调用WCF服务 - Impersonate User in SharePoint 2010 web part to call WCF service SharePoint 2010-此页面上的Web部件或Web窗体控件无法显示或导入。 该类型未注册为安全 - SharePoint 2010 - A Web Part or Web Form Control on this Page cannot be displayed or imported. The type is not registered as safe SharePoint加载项用户可以更改Web部件的颜色 - SharePoint Add-in user can change color of web part FieldValidators和Visual Web部件(Sharepoint 2010) - FieldValidators and Visual Web Part (Sharepoint 2010) Sharepoint 2010中的自定义AnnouncementListItem可视Web部件 - Custom AnnouncementListItem Visual Web Part in Sharepoint 2010 如何通过代码访问SharePoint 2010中内容查询Web部件的分组属性? - How can I access through code the Grouping property for a Content Query Web Part in SharePoint 2010?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM