How to set Autoconfigure property in codebehind?

  •  04-15-2007, 4:30 AM

    How to set Autoconfigure property in codebehind?

    Greetings,
     
    I am currently using the CE control in a DetailsView control for enabling users to insert/update content to their web pages.  I would like to be able to set the AutoConfigure property in the code-behind (C#) based on a user authorization setting from the database, but am having a difficult time getting it to work.  I'm aware that there are config files based on user roles, but I had built a custom login page that runs against a simple admins table before I became aware of the roles config files, and I don't have time on this project to integrate the login controls with SQL Server.
     
    Here's the general code that I've been using (note that the DetailsView control, dvContent, is in readonly="readonly" mode by default, and the CuteEditor control, Editor1, has AutoConfigure set to Full by default):
     
    ---
    if(dvContent.CurrentMode == DetailsViewMode.Edit || dvContent.CurrentMode == DetailsViewMode.Insert)
    {
       CuteEditor.
    Editor ce = (CuteEditor.Editor)dvContent.FindControl("Editor1");
       ce.AutoConfigure = CuteEditor.
    AutoConfigure.Minimal;
       Response.Write("<script>alert('" + ce.AutoConfigure.ToString() + "');</script>");
    }
    ---
     
    I have placed into the Page_Load, Page_PreRender and Page_Render events, and while the alert box above does display the new AutoConfigure setting, the editor itself never seems to make the change.
     
    I am still relatively new to ASP.NET 2.0, so I'm still feeling my way through some of this.  I was able to integrate the editor with no problem, and have been able to do most of what I need to do, but this particular setting is beating me at the moment.  So, any help with this issue would be greatly appreciated!
     
    Thanks very much in advance,
     
    -wrsowner
     
    Filed under:
View Complete Thread