This is a migrated thread and some comments may be shown as answers.

File selection causes multiple instances to be created...

2 Answers 44 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 04 Feb 2013, 04:19 PM

Hey guys,

I have the Kendo stuff setup with Visual Studio 2012 and MVC 4 and everything seems to be working OK. However, the upload functionality is not working as expected. See the attached image for more details. It doesn't matter where in the application I place the upload, I get the same results. However, if I create a project from the Kendo project template the Upload piece works and I do not get the repeated items placed into the page. More than anything I need to know what I am missing.

Thanks!

<div>
                                @using (Html.BeginForm("UploadFile", "Home", FormMethod.Post, new { id = "uploadForm" + item.CorrespondenceId.ToString(), enctype = "multipart/form-data"})){
                                 
                                    @(Html.Kendo().Upload()
                                        .Name("files").Multiple(true)
                                    )
                                    <p>
                                        <input type="submit" value="Submit" class="k-button" />
                                    </p>
                                }
                                 
                            </div>

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 05 Feb 2013, 02:19 PM
Hello Michael,

 
I am not sure what is the exact reason for this strange behavior, but I assume that the Upload widget is initialized more than once. If it is convenient for you, could you send us a working sample project so we could inspect it locally and assist you further?

Regards,
Dimiter Madjarov
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Michael
Top achievements
Rank 1
answered on 05 Feb 2013, 03:38 PM

Thanks Dimiter! That was it! I had the upload control in a detail template for my grid and was not assiging it a unique name. Strange behavior but once I appended the item.id to the name of the upload control specified in my template everything works!

Thanks for the help.

@using (Html.BeginForm("UploadFile", "Home", FormMethod.Post, new { id = "uploadForm" + item.CorrespondenceId.ToString(), enctype = "multipart/form-data"})){
                                 
                                    @(Html.Kendo().Upload()
                                        .Name("files" + item.CorrespondenceId.ToString()).Multiple(true)
                                    )
                                    <p>
                                        <input type="submit" value="Submit" class="k-button" />
                                    </p>
                                }
Tags
Upload
Asked by
Michael
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Michael
Top achievements
Rank 1
Share this question
or