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

Setting "Save" routing values dynamically

2 Answers 172 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Damir
Top achievements
Rank 1
Damir asked on 29 Jul 2014, 02:05 PM
I have a Kendo().Upload() defined in MVC4.
My events handlers are defined as:
.Events(ev => ev.Select("onFileSelected"))

My asynchronic is defined as.
.Async(a => a.Save("uploadFile", "uploadEmailAddresses", new { intListDescID = "[intListDescIDSelected]", campaignID = "[campaignIDSelected]" }))

As You see I am using routing parameters and it is working fine on my uploadFile  ActionResult within the uploadEmailAddresses controller.
But my values within the route need get changed dynamically as for two dropdowns result
<select id=”campaignIDSelected”></select> 
and 
<select id=” intListDescIDSelected”></select>.

How can I change those two routing values from within the function onFileSelected(e)?

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Madjarov
Telerik team
answered on 29 Jul 2014, 02:17 PM
Hello Damir,


You could change the async.saveUrl configuration option at any time, even in the upload event handler.
E.g.
.Events(e => e.Select("onSelect"))
function select(e) {
    this.options.async.saveUrl = "/Upload/NewSaveHandler";
}

I wish you a great day!

Regards,
Dimiter Madjarov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Damir
Top achievements
Rank 1
answered on 29 Jul 2014, 02:41 PM
Full of me...how couldn't I think about it before??. Thanks very much!!
Tags
Upload
Asked by
Damir
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Damir
Top achievements
Rank 1
Share this question
or