# Displaying User Messages

Some Server Events are designed to display messages to the user based on a return value. For the other server events a user message can be displayed by throwing the following exception method.

WrUserMessage(string messageOrId, wrUserMessageType Type)

Description | Displays a message to the user.
Remarks | wrUserMessageType can either be Text or Id. Text – The user message will display the string message Id – The user message will display the string associated with the Id in the Language Files. This requires a reference to WebReports.Api.Common
Example |
    //OnWebServiceExecuteEnd, inspect the returned value and throw a
    //message if it matches any of the error messages.

    object webServiceResult = args[0];

    switch(webServiceResult.ToString())
    {
        case "message1" : throw new WrUserMessage("Some Message to User", WrUserMessageType.Text);
    }
    return webServiceResult;

> Note: This cannot be used for the Events OnConfigLoadStart, OnConfigLoadEnd or OnExceptionThrown.