Ive tried this and e.AdditionaldataFields is always null serverside, can you provide a working example ?
I know this post is older, however, running into the same issue. When trying to run the attached sample, all of the infragistics .js files are missing in 7587.IgniteUISample\IgniteUISample\Scripts\Infragistics\js
Is it possible to get an updated sample targeting .Net Framework 4.8, Infragistics 2021.1?
Infragistics.Web.Mvc (v5.17.2.202)
Thanks!
Hello Mark,
I'm attaching a sample for your reference.
In the sample the "Index.cshtml" contains the igUpload configuration where the ID("upload1") and ControlId("upload1") are set in order to make the client-side and server-side event wiring. Also the onFormDataSubmit event is handled in order to send the additional data with the file upload to the server:
<script> $(function () { $("#upload1").on("iguploadonformdatasubmit", function (evt, ui) { $("#upload1").igUpload("addDataField", ui.formData, { "name": "Test Name", "value": "Test value" }); }); }); </script> @Html.Infragistics().Upload().ID("upload1").ControlId("upload1").Render()
In "Global.asax" there is the server-side event wiring with this code:
UploadProgressManager.Instance.AddStartingUploadEventHandler("upload1", new EventHandler<UploadStartingEventArgs>(HomeController.igUpload_UploadStarting));
In the "HomeController.cs" there is the server-side "StartingUpload" event handler:
public static void igUpload_UploadStarting(object sender, Infragistics.Web.Mvc.UploadStartingEventArgs e) { foreach (var dataField in e.AdditionalDataFields) { string fieldName = dataField.Name; string fieldValue = dataField.Value; } }
Best regards, Martin Pavlov Infragistics, Inc.
7587.IgniteUISample.zip