dynamically load files to the editor

Last post 12-01-2003, 3:08 AM by rull. 2 replies.
Sort Posts: Previous Next
  •  10-12-2003, 2:37 PM 20

    dynamically load files to the editor

    I've got several variables stored as session variables that I don't want the end user to see when using the cuteeditor.net version, but the subroutine designed to run at server is not "seeing" my session variables.  Can someone tell me what's wrong with the following, it's a modified version of one of the examples:


      Public Sub Page_Load(sender As object, e As System.EventArgs)

        Dim strFilePath as string = ""
        strFilePath = session("rootfolder") & request.querystring("File")

        if strFilePath <> "" then
          Dim oInput As New StreamReader(strFilePath)
          Dim sContent As String = ""
            sContent = oInput.ReadtoEnd()
            editor1.text = sContent
            oInput.close()
        end if
     End Sub


    In this example, session("rootfolder") = "c:\myfolder\" and request.querystring("File") = "test.html"

    When I run this, the session variable is blank and the streamreader line tries to open "c:\tes.html" which doesn't exist, so I get an error!

    Thanks in advance for any help.

    Gary Lantz

  •  10-13-2003, 9:24 AM 21 in reply to 20

    Re: dynamically load files to the editor

    I found a workaround by passing the data as a form post, then storing it in a local label for later use. 

    My routine is very large, but if anyone has similar problems, let me know.

    Gary Lantz

     

  •  12-01-2003, 3:08 AM 100 in reply to 20

    Re: dynamically load files to the editor

    I tried to load files in such way but I had some troubles.

    After any post event, editor1.text = sContent doesn't work in 2.0 version, but in 1.8 version all is fine.

View as RSS news feed in XML