Setting "Save" routing values dynamically

3 posts, 1 answers
  1. Damir
    Damir avatar
    5 posts
    Member since:
    Mar 2014

    Posted 29 Jul 2014 Link to this post

    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. Answer
    Dimiter Madjarov
    Admin
    Dimiter Madjarov avatar
    2153 posts

    Posted 29 Jul 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Damir
    Damir avatar
    5 posts
    Member since:
    Mar 2014

    Posted 29 Jul 2014 in reply to Dimiter Madjarov Link to this post

    Full of me...how couldn't I think about it before??. Thanks very much!!
Back to Top