We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

params

I need to pass a customer ID for an uploadbox control on the SaveUrl("uploadFunction") call. On the Classic MVC control I could pass it on the RouteValues collection.

Is it possible to pass parameter ?

thanks

John





5 Replies

HP Harikrishnan P Syncfusion Team June 13, 2014 01:20 PM UTC

Hi John,

Sorry for the inconvenience caused.

At present there is no option to pass additional parameters to controller through save url or through events, and we have logged this as Feature Request.  We will implement this feature in any of our future releases. We usually have an interval of at least three months between releases. And the feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. So we request you to check with the product page in our website regarding this feature in the upcoming release. We will update this thread once this feature has been implemented.

Please let us know if you have any queries.

Regards,

HariKrishnan



AH Ali Hatam replied to Harikrishnan P December 13, 2016 05:33 AM UTC

Hi John,

Sorry for the inconvenience caused.

At present there is no option to pass additional parameters to controller through save url or through events, and we have logged this as Feature Request.  We will implement this feature in any of our future releases. We usually have an interval of at least three months between releases. And the feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. So we request you to check with the product page in our website regarding this feature in the upcoming release. We will update this thread once this feature has been implemented.

Please let us know if you have any queries.

Regards,

HariKrishnan


Hi 
Are passing additional parameter supported by uploadbox now ?


PO Prince Oliver Syncfusion Team December 14, 2016 01:05 PM UTC

Hi John, 
 
Thanks for your update. 
 
Yes, now we have provided support to pass additional parameter to controller while uploading file. 
In the ClientSide Begin event, set ‘args.data’ for sending data to server. 
@Html.EJ().Uploadbox("UploadDefault").SaveUrl("SaveDefault").RemoveUrl("RemoveDefault").ClientSideEvents(e => e.Begin("onbegin")) 
 
<script type="text/javascript"> 
        function onbegin(args) 
        { 
            args.data = "customer ID"; // //set args.data for sending data to server. //  
        } 
    </script> 
 
Using HttpContext.Request.Form ["controlID_data"] – statement, we have to handle the client side data in controller. 
public ActionResult SaveDefault(IEnumerable<HttpPostedFileBase> UploadDefault) 
         { 
            string AdditionParam = HttpContext.Request.Form["UploadDefault_data"];// data is received here 
            foreach (var file in UploadDefault) 
             { 
                 var fileName = Path.GetFileName(file.FileName); 
                 var destinationPath = Path.Combine(Server.MapPath("~/App_Data"), fileName); 
                 file.SaveAs(destinationPath); 
             } 
             return Content(""); 
         } 
 
We have attached a sample for your convenience, refer to the following for sample: 
 
Regards, 
Prince 



AH Ali Hatam December 14, 2016 11:00 PM UTC

thanks a lot


PO Prince Oliver Syncfusion Team December 15, 2016 06:04 AM UTC

Hi John, 
  
Most welcome, we are glad to help. 
  
Regards, 
Prince 


Loader.
Up arrow icon