HttpHandlerUrl property with parameter?

5 posts, 0 answers
  1. alien9882
    alien9882 avatar
    6 posts
    Member since:
    Jan 2007

    Posted 15 Feb 2011 Link to this post

    Hi,

    When I set HttpHandlerUrl like "~/Handler.ashx?ID=1&Name=b", I got the following error:
    ~/Handler.ashx?ID=1&Name=b is not a valid virtual path.

    It would make life much easier if I can directly pass value through query string rather than implementing configuration object and so on,

    Is it possible??

    Thanks,
    Charlie




  2. alien9882
    alien9882 avatar
    6 posts
    Member since:
    Jan 2007

    Posted 16 Feb 2011 Link to this post

    No one answered this??

    All right I gave up and went back the way to implement AsyncUploadConfiguration object, but still couldn't get it working. The value of additional fields didn't pass to the handler??

    Any ideas????

    On the Default.aspx.cs
    MyNamespace.FileConfig oConfig = AsyncUpload1.CreateDefaultUploadConfiguration<MyNamespace.FileConfig>();
    oConfig.Name= "Charlie";
    oConfig.Account= "blalbalba";
    AsyncUpload1.UploadConfiguration = oConfig;
    AsyncUpload1.HttpHandlerUrl = "~/Test/Handler.ashx";


    namespace MyNamespace
    {
        public class FileConfig : AsyncUploadConfiguration
        {
            private string sName = string.Empty;
            public string Name
            {
                get { return sName ; }
                set { sName = value; }
            }
     
            private string sAccount= string.Empty;
            public string Account
            {
                get { return sAccount; }
                set { sAccount= value; }
            }
     
        }
    }

    namespace MyNamespace
    {
        public class FileConfigResult : AsyncUploadResult
        {
            private string sFileID;
     
            public string FileID
            {
                get { return sFileID; }
                set { sFileID = value; }
            }
        }
    }


    public class Handler : AsyncUploadHandler, System.Web.SessionState.IRequiresSessionState
    {
        protected override IAsyncUploadResult Process(UploadedFile file, HttpContext context, IAsyncUploadConfiguration configuration, string tempFileName)
        {
            // Call the base Process method to save the file to the temporary folder
            // base.Process(file, context, configuration, tempFileName);
     
            // Populate the default (base) result into an object of type SampleAsyncUploadResult
            AsyncUploadResult result = CreateDefaultUploadResult<MyNamespace.FileConfigResult>(file);
            
           //Name and Account are empty in the object!!
            MyNamespace.FileConfig oConfig = configuration as MyNamespace.FileConfig;
     
              return result;
          }
    }

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 18 Feb 2011 Link to this post

    Hi alien9882,

    We are currently implementing passing custom parameters in the query string. I believe we will be able to present a solution for the upcoming Q1 release.

    As for the configuration object not passing values to the handler, please, update to the latest possible version and try again. There used to be an issue with the custom configuration but we have resolved it. Does the issue persist after the upgrade?

    Kind regards,
    Genady Sergeev
    the Telerik team
  5. alien9882
    alien9882 avatar
    6 posts
    Member since:
    Jan 2007

    Posted 20 Feb 2011 Link to this post

    Hi,

    Thanks for your reply. We purchased the product on Jan 2011 so I suppose it's the latest one?
    Any schedule for Q1 release?

    Thanks,
    Charlie
  6. alien9882
    alien9882 avatar
    6 posts
    Member since:
    Jan 2007

    Posted 21 Feb 2011 Link to this post

    Hi again,
    After installing latest one the problem is solved.

    Thanks,
    Charlie 
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017