Skip to main content
.NET 8.0+

ActionUrl Class

An Action which is used to redirect a browser to a specified page.

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public class ActionUrl :
    ActionBase

Remarks

The ActionUrl class inherits the basic Action functionality from the ActionBase class. XAF only supports URL Actions in ASP.NET Core Blazor and ASP.NET Web Forms applications.

Use ActionUrl to invoke a browser and pass a URL to it. To specify link anchor text, use the ActionUrl.TextFormatString property. To specify the URL, use the ActionUrl.UrlFormatString property. To use a property value within the URL or anchor text, use ActionUrl.UrlFieldName and ActionUrl.TextFieldName properties. See property descriptions for more information about associated restrictions.

The ActionUrlcan be visualized by any of the following controls:

  • ASP.NET Web Forms
    • A menu item
    • A Grid column
  • ASP.NET Core Blazor
    • A Toolbar item
    • A Grid column
    • A Grid row’s context menu

For more information, refer to the following topic: Action Containers.

A List View can display an action in an additional column. Each cell displays a link that uses corresponding row/object data. In such cases, you can use UrlFieldName and TextFieldName properties to specify data-driven link content.

The following example configures an ActionUrl object to display hyperlinks in an additional grid column:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
// ...
public class ActionUrlController : ViewController {
    ActionUrl urlAction;

    public ActionUrlController() {
        urlAction = new ActionUrl(this, "ShowUrlAction", "ListView");
        urlAction.SelectionDependencyType = SelectionDependencyType.RequireSingleObject;
        urlAction.UrlFieldName = "Text";
        urlAction.UrlFormatString = "http://www.google.com/?q={0}";
        urlAction.TextFormatString = "Caption for {0}";
        urlAction.TextFieldName = "Text";
    }
}

Alternatively, you can use the ActionUrl Action to show a static URL that is independent from selected objects:

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
// ...
public class ActionUrlController : ViewController {
    ActionUrl urlAction;

    public ActionUrlController() {
        urlAction = new ActionUrl(this, "ShowUrlAction", "RecordEdit");
        urlAction.SelectionDependencyType = SelectionDependencyType.Independent;
        urlAction.UrlFormatString = "http://www.google.com/";
    }
}

The ActionUrl class is not designed for other scenarios.

Implements

See Also