예제 #1
0
    /// <summary>
    /// Click action on hidden button.
    /// </summary>
    protected void hdnButton_Click(object sender, EventArgs e)
    {
        if (Validate())
        {
            // Get selected item information
            var props = GetItemProperties();

            // Get JavaScript for inserting the item
            var script = CMSDialogHelper.GetFileSystemItem(props);
            if (!string.IsNullOrEmpty(script))
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "insertItemScript", script, true);
            }
        }
    }
예제 #2
0
    /// <summary>
    /// Returns selected item parameters as name-value collection.
    /// </summary>
    public void GetSelectedItem()
    {
        if (ItemProperties.Validate())
        {
            // Get selected item information
            var props = ItemProperties.GetItemProperties();

            // Get JavaScript for inserting the item
            var script = CMSDialogHelper.GetFileSystemItem(props);
            if (!string.IsNullOrEmpty(script))
            {
                ScriptManager.RegisterStartupScript(Page, typeof(Page), "insertItemScript", script, true);
            }
        }
        else
        {
            // Display error message
            pnlUpdateProperties.Update();
        }
    }