Dynamically Change the View between "Normal", "HTML", and "Preview"

Last post 02-23-2005, 2:04 PM by Adam. 3 replies.
Sort Posts: Previous Next
  •  02-22-2005, 4:21 AM 4205

    Dynamically Change the View between "Normal", "HTML", and "Preview"

    To save on resoures I load the HTML editor into a frame and dynamically update and retrieve the contents of the editor window from a different page/frame. This is very effective for speed and performance where I need to use the editor frequently for different text changes.
     
    However is does pose a problem that I need a solution for.

    I need to be able to Dynamically change the View of the editor to "Normal" from either "HTML" or "Preview" using VBScript. Is this possible? If so, can anyone please supply the code.
     
    Many Thanks
    Rob
     
  •  02-22-2005, 5:11 AM 4206 in reply to 4205

    Re: Dynamically Change the View between "Normal", "HTML", and "Preview"

    Figured it out (nearly). There is a function called EditorView in WinIE.js. I can call this function from the Editor Page using the On Click Event of a button (JavaScript) as below
     
    onclick="EditorView(Editor1.0)"
     
    Where:
    0 = Normal View
    1 = HTML
    2 = Preview
     
    This allows me to set the view of the page as desired. Just need to get this working now from VBScript
     
  •  02-23-2005, 4:47 AM 4228 in reply to 4205

    Re: Dynamically Change the View between "Normal", "HTML", and "Preview"

    Unfortunately I can't find a way to call this function outside of the scope of the editor page.

    Any help would be appreciated.

    Thanks

    Rob

  •  02-23-2005, 2:04 PM 4245 in reply to 4228

    Re: Dynamically Change the View between "Normal", "HTML", and "Preview"

    Rob,
     
    Normal:
    Response.Write("<script>EditorView(Editor1,0)</script>")

    HTML: 
    Response.Write("<script>EditorView(Editor1,1)</script>")

    Preview: 
    Response.Write("<script>EditorView(Editor1,2)</script>")

    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