Skip to main content
.NET 6.0+

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ActionUrl Class

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

Namespace: DevExpress.ExpressApp.Actions

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public class ActionUrl :
    ActionBase

#Remarks

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

Use ActionUrl to invoke a browser and pass an URL to it.

To specify the text of this link, use the ActionUrl.TextFormatString property.

To specify the URL, use the ActionUrl.UrlFormatString property.

To insert a value from the specified property to an URL or to an Action caption, use ActionUrl.UrlFieldName and ActionUrl.TextFieldName properties. See property descriptions for a list of associated restrictions.

ActionContainerHolder and ASPxGridViewContextMenu Action Containers create visual controls for ActionUrl. Other containers do not support this functionality.

XAF processes UrlFieldName and TextFieldName properties only when an Action is displayed in a separate grid column. The following example demonstrates how to configure ActionUrl for this scenario:

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