Not there yet

Last post 12-05-2005, 2:35 PM by ryager. 2 replies.
Sort Posts: Previous Next
  •  12-04-2005, 7:39 PM 13363

    Not there yet

    Ok, this is what I tried: (Attempt 1)


    Protected
    WithEvents Editor As CuteEditor.Editor
     
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        'Dim Editor As New CuteEditor.Editor
        Response.Write("Text before editor<br>")
        ShowAnEditor()
        Response.Write("<br>Text after editor")
    End Sub
    Private Sub ShowAnEditor()
        Try
            Editor.Text = "This is a test"                                    '<- THIS IS THE ERROR LINE (On Attempt 1)
            Dim sb As New System.Text.StringBuilder
            Dim sw As New System.IO.StringWriter(sb)
            Dim htw As New System.Web.UI.HtmlTextWriter(sw)
            Editor.RenderControl(htw)                                        '<- THIS IS THE ERROR LINE (On Attempt 2)
            Response.Write(sb.ToString)
        Catch ex As Exception
            Response.Write(ex.ToString)
        End Try
    End Sub


    This is the output I got:
     
    Text before editor
    System.NullReferenceException: Object reference not set to an instance of an object. at admin.WebForm1.ShowAnEditor() in C:\Documents and Settings\ryager.RYAGER\VSWebCache\royalworldresorts.com\admin\WebForm1.aspx.vb:line 37
    Text after editor
     
     
     


    So I modified the 1st line of code by adding the NEW directive to look like this: (Attempt 2)
     
    Protected WithEvents Editor As new CuteEditor.Editor



    This is the output I got:

    Text before editor
    System.NullReferenceException: Object reference not set to an instance of an object. at CuteEditor.a.e(HtmlTextWriter A_0) at CuteEditor.a.j(HtmlTextWriter A_0) at CuteEditor.a.i(HtmlTextWriter A_0) at CuteEditor.a.k(HtmlTextWriter A_0) at CuteEditor.Editor.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at admin.WebForm1.ShowAnEditor() in C:\Documents and Settings\ryager.RYAGER\VSWebCache\royalworldresorts.com\admin\WebForm1.aspx.vb:line 42
    Text after editor
     


    I think we are getting closer just not there yet, any assistance would be helpful.
     
  •  12-05-2005, 2:10 PM 13394 in reply to 13363

    Re: Not there yet

    ryager,
     
    Does your WebForm1.aspx include the following code?
      
    <CE:Editor id="Editor" runat="server"></CE:Editor>

    Actually there are some code examples in the download package.

    Please check:

    create_a_custom_button.aspx
    create_a_custom_button.aspx.vb

    Keep me posted

     
     

    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

  •  12-05-2005, 2:35 PM 13397 in reply to 13394

    Re: Not there yet

    I actually got this working thank you, it was missing the tag
     
View as RSS news feed in XML