将WebPart添加到“应用程序"页面 [英] Add a WebPart to an Application page
问题描述
我有一个从SharePoint Designer创建的数据视图Web部件".我将Web部件作为"Web部件"添加到我的Visual Studio项目中.我想知道如何将Web部件添加到应用程序页面.
I have a "Data view web part" created from SharePoint Designer. I added the web part to my visual studio project as a "Web Part" . I want to know how to add the web part to an application page.
推荐答案
我知道这很晚,但是今天我不得不做同样的事情,所以我在sharepoint.stackexchange.com上做了一个很好的回答.但基本上就像在APS.NET页上添加任何其他asp.net控件一样.
Hi i know its kind of late but, today i had to do the same thing, so i followed a great answer on sharepoint.stackexchange.com. But basically is like adding any other asp.net control on an APS.NET page.
首先,您需要为该程序集定义前缀
First you need to define the prefix for that assembly
<%@ Register tagprefix="prefix" namespace="NameSpaceOfTheWebPart" assembly="FullAssemblyName" %>
例如:
<%@ Register tagprefix="csm" namespace="MySolution.VisualWebPart" assembly="MySolution Version=1.0.0.0, Culture=neutral, PublicKeyToken=335eef5f6f60e56b" %>
,然后使用asp.net所需的属性(ID和Runat)将Web部件添加到页面(在主占位符上).
and then add the web part to the page (on the main place holder) using the required attributes by asp.net (ID and runat).
<prefix:WebPartClassName ID="ID" runat="server" />
唯一的事情是您将无法通过浏览器编辑页面和修改Web部件,如果需要修改Web部件的任何其他属性,则必须使用html或代码来进行操作在后面.
The only thing is that you won't be able to edit the page and modify the Web Part through the browser, if you need to modify any other property of the Web Part you will have to do it from the html or code behind.
这是我关注的链接的网址: https://sharepoint.stackexchange.com/questions/26508/is-it-possible-to-add-web-parts-to-application-page
here is the url of the link i followed: https://sharepoint.stackexchange.com/questions/26508/is-it-possible-to-add-web-parts-to-an-application-page
我希望能帮上忙.
这篇关于将WebPart添加到“应用程序"页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!