Skip to main content
Tab

CallbackEventArgsBase.Parameter Property

Gets a string that contains specific information (if any) passed from the client side.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.2.dll

NuGet Package: DevExpress.Web

Declaration

public string Parameter { get; }

Property Value

Type Description
String

A string value that contains specific information collected on the client side and passed to the event for further server-side processing.

Remarks

Use the Parameter property to obtain specific information which has been collected on the client side and passed via a web control’s PerfromCallback (or SendCallback) method to the server for further server-side processing.

Example

The example below demonstrates how to manipulate ASPxHtmlEditor View Areas by CustomToolbarButton.

View Example

<script type="text/javascript">
    function OnCustomCommand(s, e) {
        if(e.commandName == "close") {
            cp.PerformCallback("closed");
        }
        if(e.commandName == "open" || e.commandName == "new")
            if(confirm("Are you sure?"))
            cp.PerformCallback("opened");
    }    
</script>

</head>
<body>
    <form id="form1" runat="server">
    <dx:ASPxCallbackPanel ID="cp" runat="server" ClientInstanceName="cp" OnCallback="cp_Callback">
        <PanelCollection>
            <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
                <dx:ASPxHtmlEditor ID="htmlEditor" runat="server">
                    <ClientSideEvents CustomCommand="OnCustomCommand" />
                    <Toolbars>
                        <dx:HtmlEditorToolbar>
                            <Items>
                                <dx:CustomToolbarButton CommandName="new" Text="New">
                                </dx:CustomToolbarButton>
                                <dx:CustomToolbarButton CommandName="open" Text="Open">
                                </dx:CustomToolbarButton>
                                <dx:CustomToolbarButton CommandName="save" Text="Save">
                                </dx:CustomToolbarButton>
                                <dx:CustomToolbarButton CommandName="close" Text="Close">
                                </dx:CustomToolbarButton>
                            </Items>
                        </dx:HtmlEditorToolbar>
                    </Toolbars>
                </dx:ASPxHtmlEditor>
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxCallbackPanel>
    </form>
</body>
</html>
using System;

public partial class _Default : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {
        if(!IsPostBack && !IsCallback)
            Session["ViewVisible"] = false;
    if(Session["ViewVisible"]!=null) {
            htmlEditor.Settings.AllowHtmlView = (bool)Session["ViewVisible"];
            htmlEditor.Settings.AllowPreview = (bool)Session["ViewVisible"];
    }
    }

    protected void cp_Callback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) {
        if(e.Parameter == "opened") {
            htmlEditor.Settings.AllowHtmlView = true;
            htmlEditor.Settings.AllowPreview = true;
            Session["ViewVisible"] = true;
        }
        if(e.Parameter == "closed") {
            htmlEditor.Settings.AllowHtmlView = false;
            htmlEditor.Settings.AllowPreview = false;
            Session["ViewVisible"] = false;
        }
    }
}
See Also