HtmlWidgetHelpers Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Helper methods for building and validating HTML widget messages.
public static class HtmlWidgetHelpers
type HtmlWidgetHelpers = class
Public Class HtmlWidgetHelpers
- Inheritance
-
HtmlWidgetHelpers
Methods
| Name | Description |
|---|---|
| BuildHtmlWidgetMarkdown(HtmlWidgetPayload, HtmlWidgetMarkdownOptions) |
Wraps an HTML widget payload in the ```html-widget markdown code fence
format required by Teams to render the widget in a message.
The widget HTML is sent as authored.
The widget owns the |
| BuildHtmlWidgetMessage(HtmlWidgetPayload, HtmlWidgetMarkdownOptions) |
Builds a message activity containing an HTML widget, ready to be sent.
The widget HTML is sent as authored, so the widget owns the |
| TryGetWidgetModelContext(MessageActivity) |
Attempts to extract an MCP UI update-model-context request from a message
activity's |
| ValidateSecurityPolicy(String, HtmlWidgetSecurityPolicy) |
Validates that external references in widget HTML are covered by the declared security policy. Returns a list of warnings for any references to origins not present in the appropriate policy field. |