Re: No display of content even tho there is content!

  •  01-17-2014, 10:25 AM

    Re: No display of content even tho there is content!

    Right have spent all day looking at this!

    I have found a fix for it and its basically setting various properties on the editor in the right place and order! In a nutshell I had to set

    Protected Sub form1_Init(sender As Object, e As EventArgs) Handles form1.Init   Editor1.AllowScriptCode = True   Editor1.EditCompleteDocument = True   Editor1.TagBlackList = ""
    End Sub
     

    I don't normally use form_init, I usually do things once in page_load if not page.ispostback.

    Protected Sub form1_Load(sender As Object, e As EventArgs) Handles form1.Load
      If Not Page.IsPostBack Then
       Editor1.AllowScriptCode = True  Editor1.EditCompleteDocument = True  Editor1.TagBlackList = ""    Using objRdr As System.Data.SqlClient.SqlDataReader = SiteDB.SiteSelectPageHTML(881)
          If objRdr.Read() Then
            If objRdr("DocTypeDTDID") = Globals.DTDTypes.HTML4_01Trans Then
              Editor1.DesignDocType = RTE.RTEDesignDocType.HTML4
            ElseIf objRdr("DocTypeDTDID") = Globals.DTDTypes.XHTML1_0Trans Then
              Editor1.DesignDocType = RTE.RTEDesignDocType.XHTML
            Else
              Editor1.DesignDocType = RTE.RTEDesignDocType.HTML5
            End If
            Editor1.Text = objRdr("HTML")
          End If
        End Using
      End If
    End Sub 

     

    However doing it here only works when you set the text, the settings seem to have been forgotten on the return postback, it seems you have to set them in init everytime whether its the first time the page is loading or being posted back. I also found I had to set them before I set the text property. This all worked in the old version, so was sort of expecting this to work in the same way.

     

    I do think its a bug in that it forgets you set the settings

      Editor1.AllowScriptCode = True   Editor1.EditCompleteDocument = True
      Editor1.TagBlackList = "" 

View Complete Thread