How to view the editor in preview mode only

Last post 01-04-2006, 1:59 PM by Adam. 5 replies.
Sort Posts: Previous Next
  •  01-03-2006, 12:07 PM 14357

    How to view the editor in preview mode only

    I am trying to use the editor in edit as well as preview modes but on separate pages.
    On the first page, I need only the edit mode and turn off the preview mode, some admin goes in and creates a form so users can enter data. At this stage I do not need a preview.
     
    When the user sees the form, he doesnt need to be able to set properties on the controls etc so I do not want him to access the edit mode. Even when I turn off all tool bars and the top and bottom bars, while in edit mode, the user can always say for instance select a checkbox and delete it. I just want him to enter values using the form in preview mode only/
    How can this be done. If this helps, I do have a developer license with code so I would greatly appreciate any pointers.
    Please email me at [email protected] if this is something that can only be done by customizing the code.
  •  01-03-2006, 1:09 PM 14361 in reply to 14357

    Re: How to view the editor in preview mode only

    No problem.
    Here are the steps:
    1. Create a new property:
      /// <summary>
      /// Specifies whether the Edit Mode tab appear.
      /// </summary>
      [Category("Appearance"),DefaultValue(true)]
      public bool ShowEditMode
      {
       get
       {
        object savedState = this.ViewState["ShowEditMode"];
        return (savedState == null) ? true : (bool) savedState;
       }
       set
       {
        ViewState["ShowEditMode"] =  value;
       }
      }


    2. Find the RenderTabMode function.

    And change the following code

        writer.AddAttribute("Command","TabEdit");
         writer.AddAttribute(HtmlTextWriterAttribute.Class,"CuteEditorButton");
         writer.AddAttribute(HtmlTextWriterAttribute.Src,ThemePath+"Images/design.gif",true);
         writer.AddAttribute(HtmlTextWriterAttribute.Title,"[[Normal]]",true);
         writer.RenderBeginTag(HtmlTextWriterTag.Img);
         writer.RenderEndTag();
    to

    if(editor.ShowEditMode)
       {
        writer.AddAttribute("Command","TabEdit");
         writer.AddAttribute(HtmlTextWriterAttribute.Class,"CuteEditorButton");
         writer.AddAttribute(HtmlTextWriterAttribute.Src,ThemePath+"Images/design.gif",true);
         writer.AddAttribute(HtmlTextWriterAttribute.Title,"[[Normal]]",true);
         writer.RenderBeginTag(HtmlTextWriterTag.Img);
         writer.RenderEndTag();
    }
     
     

    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

  •  01-04-2006, 11:09 AM 14401 in reply to 14361

    Re: How to view the editor in preview mode only

    Adam,
    This changes the display only, the page still loads in the edit mode and not the preview mode. Also, this code fires only if I set the ShowBottomBar to true. I wouldnt want the botoom bar to show at all, and even though I am working with it now, it actually seems to NOT load it in preview mode, it just hides the button that would otherwise say normal.
    I want the user to not be able to select the controls in order to check properties etc. On this page, I want them to be able to set values, check checkboxes, radio buttons, type data in text boxes like they were filling out a form.
    Thanks in advance for all your help. or in the very least where can I find the event handler for the comman button for the preview action..I need to mimic that essentially.
    Amrita
  •  01-04-2006, 1:51 PM 14419 in reply to 14401

    Re: How to view the editor in preview mode only

    Amrita,
     
    >>This changes the display only, the page still loads in the edit mode and not the preview mode.
    Try set the .ActiveTab=TabType.View; and .ShowBottomBar= false;
     
     

    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

  •  01-04-2006, 1:58 PM 14420 in reply to 14419

    Re: How to view the editor in preview mode only

    Yeah! Works like a dream..thanks a ton.
  •  01-04-2006, 1:59 PM 14422 in reply to 14420

    Re: How to view the editor in preview mode only

    You are welcome.
     
    Please note that with the above setting, you don't need to change any code.
     
     

    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 as RSS news feed in XML