[英]How to add a custom built webpart to a custom view aspx page in list definition project
[英]Install a custom ASPX file as part of a ListTemplate definition
我正在使用VSeWSS 1.3 創建范圍為“站點” 的自定義列表定義 。
<Elements Id="8924acef-84ef-4584-ade4-e3eaeb8df345" xmlns="http://schemas.microsoft.com/sharepoint/">
<ListTemplate Name="MyListDefinition"
DisplayName="MyList"
Description=""
BaseType="0"
Type="10888"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
Image="/_layouts/images/itgen.gif" />
<CustomAction
Id="MyList.Print"
Location="Microsoft.SharePoint.StandardMenu"
GroupId="ActionsMenu"
Title="Print MyItem"
Description="Print Empty copies of this form."
RegistrationType="List"
ControlAssembly="MyList, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de6e0316a726abcd, processorArchitecture=MSIL"
ControlClass="MyList.PrintActionMenu" />
<Module Name="ActionPages" Url="">
<File Url="PrintForm.aspx" Type="Ghostable" Path="MyListDefinition\PrintForm.aspx" />
</Module>
</Elements>
文件“PrintForm.aspx”在服務器上正確地安裝在... \\ 12個\\ TEMPLATE \\特點......,但它並沒有預期的URL下顯示 的http://本地主機/網站/列表/ LISTNAME /安裝列表模板並使用此模板創建新的列表實例后,使用PrintForm.aspx 。
我懷疑我在ListDefinition.xml文件(如上所示)中的和/或標簽中缺少正確的屬性。
您還應該有一個schema.xml,在schema.xml中應該有這樣的內容:
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" WebPartZoneID="Main" />
...... your form here
</Forms>
PS嘗試使用SharePoint解決方案生成器導出現有列表(VSeWSS附帶),它將為您提供完整的xml定義。 您可以將其用作參考。
在評論中張貼的鏈接中的PPS指出應在功能中注冊文件,如下所示:
<ElementFile Location="GenericList\schema.xml" />
<ElementFile Location="GenericList\DispForm.aspx" />
<ElementFile Location="GenericList\EditForm.aspx" />
<ElementFile Location="GenericList\NewForm.aspx" />
<ElementFile Location="GenericList\AllItems.aspx" />
如果它在任何地方,當模塊元素的網址為空時,我希望PrintForm.aspx出現在您網站的根文件夾中。 嘗試這個:
<Module Name="ActionPages" Url="lists/listname">
<File Url="PrintForm.aspx" Type="GhostableInLibrary" Path="MyListDefinition\PrintForm.aspx" />
</Module>
另外,嘗試使用GhostableInLibrary代替Ghostable作為文件類型。
最后,您提到PrintForm.aspx確實顯示在“功能”中的某個位置,但是沒有提供完整的路徑。 確保它在... \\ 12 \\ TEMPLATE \\ Features \\ YourFeaturesName \\ MyListDefinition \\ PrintForm.aspx中。 根據Path屬性的值,PrintForm.aspx必須位於功能中名為MyListDefinition的目錄中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.