Re: Possible to replace Common.config?

  •  06-06-2008, 9:40 AM

    Re: Possible to replace Common.config?

    wigmo,
     
    Most settings in Common.config can be dynamically generated.
     
    For example, you can programmatically populate the Code Snippet dropdown. However the whole common.config file cannot be replaced by an aspx page.
     
    Programmatically populate the Code Snippet dropdown:

    C# Example:

    if (!IsPostBack) { 
    CuteEditor.ToolControl toolctrl=Editor1.ToolControls["Codes"];
    if(toolctrl!=null) {
    CuteEditor.RichDropDownList dropdown=(CuteEditor.RichDropDownList)toolctrl.Control;
    //the first item is the caption
    CuteEditor.RichListItem richitem=dropdown.Items[0];
    //clear the items from configuration files
    dropdown.Items.Clear();
    //add the caption
    dropdown.Items.Add(richitem);
    //add text and value
    dropdown.Items.Add("Email signature","<h3>this is my email signature</h3>");
    //add html and text and value
    dropdown.Items.Add("<img border=0 align='absMiddle' src= 'http://cutesoft.net/data/contact.gif'/> Contact us","Contact us","support@cutesoft.net");
    }
    }


    VB Example:

     

    If Not Page.IsPostBack Then
      If Not Editor1.ToolControls("Codes") Is Nothing Then

          Dim dropdown As CuteEditor.RichDropDownList
          Dim richitem As CuteEditor.RichListItem

          dropdown = DirectCast(Editor1.ToolControls("Codes").Control, CuteEditor.RichDropDownList)

          'the first item is the caption
          richitem = dropdown.Items(0)

          'clear the items from configuration files
          dropdown.Items.Clear()

          'add the caption
          dropdown.Items.Add(richitem)

         'add text and value
          dropdown.Items.Add("Email signature","<h3>this is my email signature</h3>")

          'Add html and text and value
          dropdown.Items.Add("<img border=0 align='absMiddle' src= 'http://cutesoft.net/data/contact.gif'/> Contact us", "Contact us", "support@cutesoft.net")

      End If
    End If



    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View Complete Thread