Sharepoint 2007のWebパーツには、RequiredFieldValidator()
を使用して必須フィールドとして検証される1つのフィールドがあります。 Webパーツには、いくつかの設定フィールド(「共有Webパーツの変更」をクリックして編集するフィールド)もあります。Sharepoint Webパーツフォームの検証ブロックWebパーツの設定の更新
これらのフィールドに変更を加えて適用しようとすると、フォームを送信していなくても、ユーザーフィールドの検証が実行され、更新できなくなります。私は設定を提出しようとしています。 Webパーツはファームのいくつかの場所で使用できるため、サイトコレクションの管理者は設定を変更できる必要があります。私は、ユーザーのフィールドを検証するのはここ
は次のとおりです。私は、構成フィールドのいずれかを定義するのはここ
// Validate form field - required field, and max length is 100 characters.
InputFormRequiredFieldValidator messageRequiredValidator = new InputFormRequiredFieldValidator();
messageRequiredValidator.ControlToValidate = txtMessage.ID;
messageRequiredValidator.ErrorMessage = "You must write a message to send!";
messageRequiredValidator.Display = ValidatorDisplay.Dynamic;
messageRequiredValidator.Text = "<img src=\"/_layouts/images/CNSCA16.gif\"/> You must write a message to send.";
tc.Controls.Add(messageRequiredValidator);
は次のとおりです。
private string recipientEmailAddress = "[email protected]";
[WebBrowsable(true),
Personalizable(true),
WebPartStorage(Storage.Shared),
WebDescription("Email address the form should be sent to"),
WebDisplayName("Recipient Email Address"),
SPWebCategoryName("Email Settings")]
public string RecipientEmailAddress
{
get { return recipientEmailAddress; }
set { recipientEmailAddress = value; }
}
は、これはそうそこに、私が書いた最初のWebパーツです管理者の設定やユーザーからのフィールドの入力確認の方法に欠けていることがあります。
ウェブパーツを設定するときにエディタペインのフィールドを検証できるようにしたいのですが、これも無効にしていますか? – dunxd