私は非常に基本的なカスタム編集フォームを持っています。aspxにはコードがあります。これは、いくつかの追加のjavascriptで標準編集フォームの直接コピーです。 私はデザイナーと一緒にそれを開き、それをまっすぐにコピーしました。 問題は、ListFormWebPartがリストIDを必要としていることです。これは運がなくても取得しようとしています。カスタム編集フォームでListFormWebPartのList IDを取得するにはどうすればよいですか?
それは私をデバッグさせません、私は基本的に私は完全にオフになっていると私はこれを別のアプローチか、重要なものが欠けているのだろうか?
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
<WebPartPages:ListFormWebPart ID="ListFormWebPart" runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{B1433CAB-755A-4E8C-A35E-629AD2C5BB67}" >
<WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
<Title>Dokument</Title>
<FrameType>Default</FrameType>
<Description />
<IsIncluded>true</IsIncluded>
<PartOrder>2</PartOrder>
<FrameState>Normal</FrameState>
<Height />
<Width />
<AllowRemove>true</AllowRemove>
<AllowZoneChange>true</AllowZoneChange>
<AllowMinimize>true</AllowMinimize>
<AllowConnect>true</AllowConnect>
<AllowEdit>true</AllowEdit>
<AllowHide>true</AllowHide>
<IsVisible>true</IsVisible>
<DetailLink />
<HelpLink />
<HelpMode>Modeless</HelpMode>
<Dir>Default</Dir>
<PartImageSmall />
<MissingAssembly>Cannot import this Web Part.</MissingAssembly>
<PartImageLarge />
<IsIncludedFilter />
<ExportControlledProperties>true</ExportControlledProperties>
<ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID>
<ID>g_b1433cab_755a_4e8c_a35e_629ad2c5bb67</ID>
<ListName xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> <%=ListId%> </ListName>
<ListId xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm"> <%=ListId%> </ListId>
<PageType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">PAGE_EDITFORM</PageType>
<FormType xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">6</FormType>
<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode>
<ViewFlag xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">1048576</ViewFlag>
<ViewFlags xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Default</ViewFlags>
<ListItemId xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">0</ListItemId>
</WebPart>
</WebPartPages:ListFormWebPart>
</ZoneTemplate></WebPartPages:WebPartZone>
そしてここでは、背後にある小さなコードです:
public partial class RKEditForm : LayoutsPageBase
{
public string ListId { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
Debugger.Launch();
ListId = Request.QueryString["List"];
if (string.IsNullOrEmpty(ListId))
{
ListId = "123";
}
}
}
、これは、SharePointが送信するリクエストである:(ULSで拾った)
Name=Request (GET:http://rkdhs-a:80/_layouts/RK.Dhs/RKEditForm.aspx?List=12cfe831%2D9c9d%2D4393%2D85dc%2Dd522440035ca&ID=4&Source=http%3A%2F%2Frkdhs%2Da%2FDokument%2FForms%2FAllItems%2Easpx&RootFolder=%2FDokument&ContentTypeId=0x01010053E1D612BA3F4E21AA250ECD751942B3004C051FA1C7EDB047A5DE0AABD0672600&IsDlg=1)
と私はこの例外を得続けます:
System.FormatException: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
at System.Guid..ctor(String g)
at Microsoft.SharePoint.WebPartPages.ListFormWebPart.get_ItemContext()
at Microsoft.SharePoint.WebPartPages.ListFormWebPart.EnsureList()
at Microsoft.SharePoint.WebPartPages.ListFormWebPart.EnsureListAndForm()
at Microsoft.SharePoint.WebPartPages.ListFormWebPart.UseLegacyForm()
at Microsoft.SharePoint.WebPartPages.ListFormWebPart.CreateChildControls()
at System.Web.UI.Control.EnsureChildControls()
at System.Web.UI.WebControls.WebParts.Part.get_Controls()
at System.Web.UI.Control.SetRenderMethodDelegate(RenderMethod renderMethod)
at ASP._layouts_rk_dhs_rkeditform_aspx.__BuildControlListFormWebPart()
at ASP._layouts_rk_dhs_rkeditform_aspx.__BuildControl__control24(Control __ctrl)
at System.Web.UI.WebControls.WebParts.WebPartZone.GetInitialWebParts()
at System.Web.UI.WebControls.WebParts.WebPartManager.RegisterZone(WebZone zone)
at System.Web.UI.WebControls.WebParts.WebPartZone.OnInit(EventArgs e)
at Microsoft.SharePoint.WebPartPages.WebPartZone.OnInit(EventArgs e)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
これは必要ではありません。 QueryStringコレクションは、URLが移入されている間にそのURLをデコードしています。 – Servy