Esempio n. 1
0
    /// <summary>
    /// Pass the parameters to newly opened window and returns reference to these dialog parameters.
    /// </summary>
    /// <returns>URL containing reference to dialog parameters</returns>
    private string GetEditorDialogParameters()
    {
        Hashtable parameters = new Hashtable();

        parameters["editorid"]    = ValueElementID;
        parameters["allowmacros"] = AllowMacros.ToString().ToLowerCSafe();

        if (!string.IsNullOrEmpty(ResolverName))
        {
            parameters["resolvername"] = ResolverName;
        }
        WindowHelper.Add(Identifier, parameters);

        string queryString = "?params=" + Identifier;

        return(URLHelper.AddParameterToUrl(queryString, "hash", QueryHelper.GetHash(queryString)));
    }
    /// <summary>
    /// Handles the Load event of the Page control.
    /// </summary>
    /// <param name="sender">The source of the event</param>
    /// <param name="e">The System.EventArgs instance containing the event data</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        CheckMinMaxLength      = true;
        CheckRegularExpression = true;

        // Register general dialog scripts
        ScriptHelper.RegisterDialogScript(Page);

        // Assign handler that opens modal dialog
        btnMore.OnClientClick += string.Format("ShowLargeTextAreaDesigner('{0}', {1}, '{2}'); return false;", ValueElementID, AllowMacros.ToString().ToLowerCSafe(), ResolverName);

        // Register modal dialog script
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "ShowLargeTextAreaDesigner", GetDesignerScript());

        // Register script that gets/sets values between control and modal dialog
        ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "AreaGlobal", GetValueTransferScript());
    }