Returning Success State to the client

2 posts, 0 answers
  1. Eric
    Eric avatar
    19 posts
    Member since:
    Mar 2008

    Posted 17 Jul 2012 Link to this post

    I'm using the Upload extension to upload an image, pretty straighforward.  On the server I give the image file my own custom name (a guid) and then save it to server storage.  Great so far, this all works fine.  However what I would like to do is pass this new image url back to the client on the success event.  The problem is that from what I've seen so far, returning anything other than an empty string is interpreted by the upload control on the client as an error and is routed to the "onError" handler.

    Is there a way that I can pass this state back to the client and still handle it in the "onSuccess" event?  Basically I want to give this path to another control on my page so that it can refresh itself with the new URL.  The only other ways I can think to make this happen is to:

    Handle "onError" and fudge it to also handle a success by looking at what was returned. (pretty stinky)

    Have the second control perform an ajax postback "onSuccess" and reload it's own state from the server, but of course this would add an extra postback for each upload that happens.  Was hoping to avoid this if possible.

    Any ideas are appreciated, thanks!

    Eric
  2. Eric
    Eric avatar
    19 posts
    Member since:
    Mar 2008

    Posted 17 Jul 2012 Link to this post

    Just found the information on this in the docs:

    http://docs.kendoui.com/getting-started/using-kendo-with/aspnet-mvc/helpers/upload/metadata



    THanks,

    Eric S
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top