Exago Logo
Search
Generic filters
Exact matches only

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 WebReports.Api.Common.WrUserMessage(string, wrUSerMessageType) method.

Warning

This method can be used for all server events except OnConfigLoadStart, OnConfigLoadEnd and OnExceptionThrown.

WrUserMessage(string messageOrId, wrUserMessageType Type)

DescriptionDisplays a message to the user.
Arguments
  • messageOrId: either a message string, or a language file ID that contains the message content. Set the value of the type argument accordingly.
  • type: a value from the wrUserMessageType enumeration, that determines if the messageOrId argument should be treated as a string literal with the message content, or should be used to lookup a matching language file ID.
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;
Was this article helpful?
0 out of 5 stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents