Exemplo n.º 1
0
    private void LoadTreeConfig()
    {
        // we only want to run the script when the content is actually there
        if (treeConfig == null)
        {
            treeConfig = ClientConfiguration.From(this);
        }

        treeConfig.QueryState = BuildQueryFromState();

        btnAdd.Visible = true;

        // ToDo: Place this message elsewhere so that it can be displayed when the sdata returns 0
        lblEnterCriteriaMessage.Visible = false;

        StringBuilder script = new StringBuilder();

        script.AppendFormat("SmartParts.SalesOrder.AddSalesOrderProduct.create('{0}', {1})", ID,
                            JsonConvert.SerializeObject(treeConfig));

        if (ScriptManager.GetCurrent(Page).IsInAsyncPostBack)
        {
            ScriptManager.RegisterStartupScript(Page, typeof(Page), "add-salesorder-product-init",
                                                script.ToString(), true);
        }
    }