Dynamic ImageGalleryPath in VB2005

Last post 08-09-2007, 10:12 AM by pmcaron. 3 replies.
Sort Posts: Previous Next
  •  08-09-2007, 5:12 AM 32337

    Dynamic ImageGalleryPath in VB2005

    I'm using Cuteeditor in a VS2005 Website, often as a replacement template for a text box.
     
    All my users log into the website with a username and password, which means that their profile is known.
     
    I would like to specify upload directories based on the conventional "~/uploads" directory extended with a four character number that is present in my user's profiles.
     
    I was able to do this using a sub as follows :
    1. when the Editor is not in a template :

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Editor1.Setting(
    "security:ImageGalleryPath") = "~/uploads/" & Profile.District
    End Sub
     
    2. when the Editor is in a template :

    Protected Sub Editor1_Init(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim tbxEditor1 As Editor = DetailsView1.FindControl("Editor1")
    tbxEditor1.Setting(
    "security:ImageGalleryPath") = "~/uploads/" & Profile.District
    End Sub


    Then, when I upload an image I can see ~/uploads/9999 for example.

     
    The solution I found works, but I need to type a subroutine for each copy of the editor in any page.
     
    I wonder if someone has found a solution to code such a composed path in a permanent way at the session level or the application level, or even at the page level ?
     
    Thanks in advance.
  •  08-09-2007, 9:59 AM 32345 in reply to 32337

    Re: Dynamic ImageGalleryPath in VB2005

    Further to the previous question, I have a strange problem :
     
    The following routine :
     
    Protected Sub Editor1_Init(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim tbxEditor1 As Editor = DetailsView1.FindControl("Editor1")
    tbxEditor1.Setting(
    "security:ImageGalleryPath") = "~/uploads/" & Profile.District
    tbxEditor1.Setting(
    "Security:FlashGalleryPath") = "~/uploads/" & Profile.District
    tbxEditor1.Setting(
    "security:MediaGalleryPath") = "~/uploads/" & Profile.District
    tbxEditor1.Setting(
    "security:FilesGalleryPath") = "~/uploads/" & Profile.District
    End Sub
     
    works well for three of the paths. It does not work for the FlashGallerypath...
     
    Looks like a bug ?
     
  •  08-09-2007, 10:06 AM 32346 in reply to 32345

    Re: Dynamic ImageGalleryPath in VB2005

    pmcaron,
     
    It should work FlashGalleryPath as well.

    Please try this demo:
     
     
     
    The source code of this example can be found in the download package.
     
    Framework 2.0\vb\implementSecuritypolicy.aspx
    Framework 2.0\cs\implementSecuritypolicy.aspx
     
    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

  •  08-09-2007, 10:12 AM 32347 in reply to 32346

    Re: Dynamic ImageGalleryPath in VB2005

    Ahhrrgg, forget the last remark please.
     
    I should have written security instead of Security, the capital S makes the difference.
     
    Sorry.
View as RSS news feed in XML