Save to database using custom connection type

  •  05-02-2007, 5:45 PM

    Save to database using custom connection type

       The page I have put the CuteEditor Control uses a class to set values of input contol types using iteration.  The standard ASP.net controls are all defined here.  I need to know how to define the CuteEditor so that it will update the database.  The code used to define input controls is:
     

    private object[] setControl(Control ctrl)

    {

    object[] obj=new object[2];

    switch(ctrl.GetType().ToString())

    {

    case "CuteEditor.Editor":

    CuteEditor.Editor txt1 = (CuteEditor.Editor)ctrl;

    obj[0] = ctrl.ClientID;

    obj[1] = txt1.Text.ToString().Trim();

    break;

    case "System.Web.UI.WebControls.TextBox":

    TextBox txt=(TextBox) ctrl;

    obj[0]=ctrl.ClientID;

    obj[1]=txt.Text.ToString().Trim();

    break;

     

    case "System.Web.UI.WebControls.CheckBox":

    CheckBox chk=(CheckBox) ctrl;

    obj[0]=ctrl.ID;

    obj[1]=chk.Checked;

    break;

    case "System.Web.UI.WebControls.RadioButton":

    RadioButton rd=(RadioButton) ctrl;

    if(rd.Checked==true)

    obj[0]=rd.GroupName;

    obj[1]=true;

    break;
     
    I have highlighted the code that I added to define the CuteEditor control, but this code is not working.   When I place a standard textbox on the page and submit the results, the information is stored in the database.  When I replace the textbox with the CuteEditor control, the information is not stored in the database.  Can anyone help? 
View Complete Thread