开发者

FileUploader Asp mvc Telerik Asynchrounous Content

开发者 https://www.devze.com 2023-03-16 19:00 出处:网络
I tried to Use the Telerik component Upload in asp mvc . @(Html.Telerik().Upload() .Name(\"attachement\")

I tried to Use the Telerik component Upload in asp mvc .

    @(Html.Telerik().Upload()
            .Name("attachement")
    .Multiple(true)
    .Async(async => async
        .Save("Save", "Image")
        .Remove("Remove", "Image")
        .AutoUpload(true)
        ).ClientEvents(events => events.OnSuccess("onSuccess")))

In My Controller I have:

 public ActionResult Save(HttpPostedFileBase attachement)
    {
        var fileName = attachement.FileName;
        Guid id = SaveImage(attachement);

        return Json(
            new
            {
                Succces = true,
                Content=id,
            }

            );
    }

In my View I need to display the content of the Json Result , I have a event on the uploader called OnSucces

   function onSuccess开发者_运维知识库(e) {


}

How Can I get the JsonContent in this method javascript and display the content . Or all this logic is wrong . Thanks in advance


Check the sending and receiving metadata help article.

0

精彩评论

暂无评论...
验证码 换一张
取 消