Re: Problem while setting the Image Directory programatically

  •  07-05-2005, 4:47 PM

    Re: Problem while setting the Image Directory programatically

    rohitrawat,
     
    You must miss some code here.
     
    This is an example showing how to do that. You can modify it to meet your own requirements.
     
    <script runat="server"> Public Sub Page_Load(sender As object, e As System.EventArgs) If Not Page.IsPostBack Then Editor1.SecurityPolicyFile = "default.config" SetUploadsFolder("~/Uploads/Member/") Editor1.ReadOnly = false End If End Sub public Sub security_Changed(sender As object, e As System.EventArgs) Dim temp As String = "" Select Case RadioList.SelectedItem.Value case "Administrators": Editor1.SecurityPolicyFile = "Admin.config" SetUploadsFolder("~/Uploads/") case "Members": Editor1.SecurityPolicyFile = "default.config" SetUploadsFolder("~/Uploads/Member/") case "Guest": Editor1.SecurityPolicyFile = "Guest.config" SetUploadsFolder("~/Uploads/Guest/") 'case "Banned": ' Editor1.ReadOnly = true case "John": Editor1.SecurityPolicyFile = "Admin.config" SetUploadsFolder("~/Uploads/Users/John/") case "Mary": Editor1.SecurityPolicyFile = "default.config" SetUploadsFolder("~/Uploads/Users/Mary/") case "Tim": Editor1.SecurityPolicyFile = "default.config" SetUploadsFolder("~/Uploads/Users/Tim/") End Select Literal1.Text = ShowSecuritySetting() End Sub Function ShowSecuritySetting() As String Dim temp As String = "" temp = temp & "Policy file: "+ Editor1.SecurityPolicyFile temp = temp & "<br>" temp = temp & "ImageGalleryPath: "+ Editor1.Setting("security:ImageGalleryPath") temp = temp & "<br>" temp = temp & "FilesGallaryPath: "+ Editor1.Setting("security:FilesGallaryPath") return temp End Function Sub SetUploadsFolder(ByVal folder As String) Dim phyfolder As String = Server.MapPath(folder) 'see security.config Editor1.Setting("security:ImageGalleryPath")=folder Editor1.Setting("security:MediaGalleryPath")=folder Editor1.Setting("security:FlashGalleryPath")=folder Editor1.Setting("security:FilesGallaryPath")=folder End Sub </script>

    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

View Complete Thread