Share via


SPPageStateControl.SetErrorCondition method

Inserts markup that shows the specified error message along with the specified buttons when the page is rendered or the callback is completed.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Sub SetErrorCondition ( _
    ErrorMessage As String, _
    RemedialActionCount As UInteger, _
    RemedialActionButtonText As String(), _
    RemedialActionCommand As String() _
)
'Usage
Dim instance As SPPageStateControl
Dim ErrorMessage As String
Dim RemedialActionCount As UInteger
Dim RemedialActionButtonText As String()
Dim RemedialActionCommand As String()

instance.SetErrorCondition(ErrorMessage, _
    RemedialActionCount, RemedialActionButtonText, _
    RemedialActionCommand)
public void SetErrorCondition(
    string ErrorMessage,
    uint RemedialActionCount,
    string[] RemedialActionButtonText,
    string[] RemedialActionCommand
)

Parameters

  • ErrorMessage
    Type: System.String

    A string that contains the error message to return when an error occurs.

  • RemedialActionCount
    Type: System.UInt32

    An integer that contains a count of the RemedialActionButtonText array and the RemedialActionCommand array.

  • RemedialActionButtonText
    Type: []

    An array of String values that contains the button labels presented to the user in the dialog box underneath the error message.

  • RemedialActionCommand
    Type: []

    An array of String values that contains the executable ECMAScript (JScript, JavaScript) that is executed on the client when a user clicks the corresponding button.

Remarks

This is the method that handles the SetGenericErrorMessage methods that are contained in the different command handler classes.

See also

Reference

SPPageStateControl class

SPPageStateControl members

Microsoft.SharePoint.WebControls namespace