RadEditor - code for the Document and Image managers

The Telerik RadEditor becomes far more powerful once you wire up the Document and Image Managers to real, user-specific folders. Out of the box, the editor doesn’t know where your application stores files, how your users’ directories are structured, or which paths they’re allowed to browse. That’s why a clean, predictable initialization routine matters. In this article, we walk through the exact VB.NET code needed to configure the RadEditor so each user sees only their own images and documents — with proper view paths, upload paths, delete paths, and file filters. It’s a simple pattern, but once you have it in place, the RadEditor behaves consistently and securely across your entire application.
'configure image paths
Dim strImagePath As String = Path.Combine("/ClientImages", oUser.UserName)
Dim strFullPath As String = Server.MapPath(strImagePath)
If Not Directory.Exists(strFullPath) Then
    Directory.CreateDirectory(strFullPath)
End If
strImagePath = "~" & strImagePath
strImagePath = strImagePath.Replace("\", "/")
 
Dim viewImages As String() = New String() {strImagePath}
 
'configure file paths
Dim strDocumentPath As String = Path.Combine("/ClientDocuments", oUser.UserName)
Dim strDocumentFullPath As String = Server.MapPath(strDocumentPath)
If Not Directory.Exists(strDocumentFullPath) Then
    Directory.CreateDirectory(strDocumentFullPath)
End If
strDocumentFullPath = "~" & strDocumentFullPath
strDocumentFullPath = strDocumentFullPath.Replace("\", "/")
 
Dim ViewPaths As String() = New String() {strDocumentPath}
 
If Not IsPostBack Then
    RadEditor1.Modules.Clear()
    RadEditor1.SpellCheckSettings.AllowAddCustom = True
    RadEditor1.SpellCheckSettings.SpellCheckProvider = SpellCheckProvider.PhoneticProvider
 
    RadEditor1.Languages.Clear()
    RadEditor1.SpellCheckSettings.DictionaryLanguage = "en-US"
 
    RadEditor1.ImageManager.ViewPaths = viewImages
    RadEditor1.ImageManager.UploadPaths = viewImages
    RadEditor1.ImageManager.DeletePaths = viewImages
    RadEditor1.DocumentManager.ViewPaths = ViewPaths
    RadEditor1.DocumentManager.UploadPaths = ViewPaths
    RadEditor1.DocumentManager.DeletePaths = ViewPaths
    RadEditor1.DocumentManager.SearchPatterns = New String() {"*.doc", "*.txt", "*.docx", "*.xls", "*.xlsx", "*.pdf", "*.zip"}
End If

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences