Change image gallery path by user

Last post 10-09-2006, 12:31 PM by Adam. 2 replies.
Sort Posts: Previous Next
  •  10-04-2006, 6:31 PM 23356

    Change image gallery path by user

    I am trying to change the image gallery path by user, we have a need to keep the images seperated by users so that a different dll can use them. The code is below:
     
    CuteEditor.Editor editor1 = (CuteEditor.Editor)(FormView1.FindControl("MyAnswerTextBox"));
    editor1.SetSecurityImageGalleryPath =
    @"C:\Inetpub\wwwroot\app1\Users\" + UserName + @"\MyPics";
     
    I receive the following error:
    Compiler Error Message: CS1656: Cannot assign to 'SetSecurityImageGalleryPath' because it is a 'method group'
     
    The cuteeditor sits in a formview template, so how do I get this to work?
     
    Thanks,
  •  10-08-2006, 8:50 AM 23401 in reply to 23356

    Re: Change image gallery path by user

    OK, figured it out. Not sure, but the documentation seems to be a little misleading, it lists the following:
    Editor1.SetSecurityImageGalleryPath= "~/uploads";
    but here is how I got it to work:

    protected void FormView1_PreRender(object sender, EventArgs e)

       {

          try

             {

             string theUser= ....some code
             ............... some code

          CuteEditor.Editor editor1 = (CuteEditor.Editor)(FormView1.FindControl("MyAnswerTextBox"));

          if (editor1 != null)

          {

          string securityPath = Server.MapPath(MyPath + theUser + @"/MyPics");
          .... some code
          editor1.SetSecurityImageGalleryPath(securityPath);
          ... some code
     
    Thanks,
     
     
  •  10-09-2006, 12:31 PM 23415 in reply to 23401

    Re: Change image gallery path by user

    scanner2001,
     
    Thanks for pointing out this issue. Sorry for the inconvenience.
     
    The correct syntax should be:
     
    //use the app-based path 

    Editor1.SetSecurityImageGalleryPath("~/uploads")
    //use the absolute path 
    Editor1.SetSecurityImageGalleryPath("/uploads")
    //use the physical path 
    Editor1.SetSecurityImageGalleryPath("c:\inetpub\wwwroot\uploads") 
     
     

    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 as RSS news feed in XML