ValidationSummary.BackLabel 属性

定义

获取或设置验证摘要中链接到包含错误的窗体的字符串。 默认值是 Empty。 此 API 已废弃不用。 有关如何开发 ASP.NET 移动应用程序的信息,请参阅 移动应用 & 具有 ASP.NET 的网站

public:
 property System::String ^ BackLabel { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string BackLabel { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.BackLabel : string with get, set
Public Property BackLabel As String

属性值

验证摘要中链接到包含错误的窗体的字符串。

属性

示例

下面的代码示例演示如何使用 BackLabel 属性指定 中的 ValidationSummary 链接文本,以返回到出现错误的窗体。

private void OnCmdClick(Object sender, EventArgs e)
{
    if (Page.IsValid)
        ActiveForm = Form2;
    else
    {
        ValSummary.BackLabel = "Return to Form";
        ActiveForm = Form3;
    }
}
Private Sub OnCmdClick(ByVal sender As Object, ByVal e As EventArgs)
    If Page.IsValid Then
        ActiveForm = Form2
    Else
        ValSummary.BackLabel = "Return to Form"
        ActiveForm = Form3
    End If
End Sub

注解

在呈现窗体期间发生错误时,验证过程将使用 属性中的 BackLabel 文本作为验证摘要页上显示的字符串。

适用于

另请参阅