-
10-12-2019 - |
質問
サイトのコントロールを介してPAGE_LOADでSPWEBを作成しようとしています。 「このページのセキュリティ検証は無効です」というエラーが表示されます。
ポストバック(get-request)を持っていて、またoninit-methodのsputility.validateFormDigestを試して、RunWithElevatedPrivieaguesの直前に。
私は自分のコントロールのASCXにフォームに優しいコントロールを入れました。 MasterPageはSeattle.Masterで、FormDigestpleceholderとControlを含みます。
ファームアカウントを持つ開発システムでは統合システム上では機能しません。私はSP2013にいます。
任意の提案?
[更新2] OK更新1のコードは本当の問題ではありませんでした。本当の問題は次の行で発生しました:
.
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "CreateMeetingRepost", "document.forms[0].submit();", true);
PAGE_LOADでは、ポストバックを取得するためにサイトを自分自身に送信するためにこのコードを登録しています。しかし、ポストバックが発生してコントロールが完全にロードされた後は、ページがセキュリティ検証エラーを他の場所にある(コードではない)。任意の提案?
私がやりたいのはサブサイトを作成することだけです。 rootweb and siteでallownsafeupdateを試しましたが、それはうまくいきませんでした。 ContentTypeを新しいWebにコピーしながら、SharePointはインレールをスローします。
[Update1 - 問題ではない] いくつかのコード - MeetingManager.CreateMeetingandFillurlはサブサイトを作成します
.SPSecurity.RunWithElevatedPrivileges(() =>
{
using (SPSite elevatedSite = new SPSite(SPContext.Current.Site.ID))
{
using (SPLongOperation operation = new SPLongOperation(this.Page))
{
operation.LeadingHTML = "Meeting wird erstellt";
operation.Begin();
MeetingManager.CreateMeetingAndFillUrl(elevatedSite, currentMeeting);
try
{
operation.End(currentMeeting.Url);
}
catch (ThreadAbortException)
{
// This exception is thrown because the SPLongOperation.End
// calls a Response.End internally
// see: http://dotnetfollower.com/wordpress/2011/08/sharepoint-how-to-use-splongoperation/
}
}
}
});
解決
I found the problem. All the code is correct but there is an error in March 2013 PU. The FormDigest is set invalid and when doing a post the error occures. This is a real bad error.