dynamically load files to the editor

  •  10-12-2003, 2:37 PM

    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

View Complete Thread