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.
Unfortunately, activation email could not send to your email. Please try again.

params

Thread ID:

Created:

Updated:

Platform:

Replies:

116579 Jun 11,2014 06:46 AM Dec 15,2016 01:04 AM ASP.NET MVC 5
loading
Tags: Uploadbox
John Hind
Asked On June 11, 2014 06:46 AM

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





Harikrishnan P [Syncfusion]
Replied On June 13, 2014 09:20 AM

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


Ali Hatam
Replied On December 13, 2016 12:33 AM

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 ?

Prince Oliver [Syncfusion]
Replied On December 14, 2016 08:05 AM

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 


Ali Hatam
Replied On December 14, 2016 06:00 PM

thanks a lot

Prince Oliver [Syncfusion]
Replied On December 15, 2016 01:04 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;