Can someone give me an example of how to do this with ASP.Net MVC? I have followed the example at their site on the file uploads tab but I cannot get a decent response back. My controller thinks that it is not a AJAXRequest and tries to do a RedirectToAction but that doesn't change the page after the post.
I wrote a blog post about how to do this here.
Try this my friend: http://www.hanselman.com/blog/ABackToBasicsCaseStudyImplementingHTTPFileUploadWithASPNETMVCIncludingTestsAndMocks.aspx
The upload isn't an AJAX request, it states clearly that you can't do a file upload using the XMLHttpRequest object so it's done using an iframe as the target. Try processing the upload just as you would for a normal non-AJAX submission.
Answer: Cannot use AJAX or use iFrame
Related
I have simple ASP.Net WebApi that use Swagger, added it using Swashbuckle. I need to show Swagger documentation as a HTML page from my ASP.Net app.
I don't know where to start, any suggestion or link would be great.
Thanks!
When you activate Swagger you can see the docu online at
https://yourpath/swagger/index.html (or something like that).
I have created a new application using the ASPNetBoilerplate MVC 5x template. I have integrated Swagger UI according to the link:
https://aspnetboilerplate.com/Pages/Documents/Swagger-UI-Integration
Again using the MVC 5x version
When I run the app and use http://localhost:/swagger to access the API and try to run any of the GetAll methods, I get a 400 error.
I have modified the .cs file and created the .js files by cutting the code directly from the documentation and made the required changes.
What am I missing?
Thanks
I hope you are not navigating to http://localhost:/swagger because there's a typo error. Correct url is http://localhost/swagger
There's no official support for bearer token for Swagger UI Api calls. But you can checkout the link below. A developer achieves what you want
https://github.com/aspnetboilerplate/module-zero-core-template/pull/87
On the KendoUI site, I've found a working example of a KendoUI grid with MVC wrappers.
I don't use those wrappers.
Is there already support for json(p) for WebApi?
I've tried with the JsonPMediaTypeFormatter, with no decent result.
I can only read for the ApiController, but the put, post and delete don't work.
any examples?
You cannot do POST over JSONP.
Yes, there is an example on github.com site look at this :
https://github.com/telerik/kendo-examples-asp-net/
or
https://github.com/telerik/kendo-examples-asp-net/tree/master/grid-webapi-crud
this is web api and you can download it az zip file then add web-api assembly to it, it works with web-api very nice.
you can search about what exactly you need on this :
https://github.com/telerik/kendo-examples-asp-net/commit/b6d70769fc226340e16a7fdb6da4329331f7927b
I'm writing an asp.net mvc application. I'm looking for free control to make file(s) upload. (Multiple files upload is not required). I found uploadify, ajax uploader, c5 filemanager.
I'm looking rather example which I could include in Razor form and add additional fields such as i.e. file description.
Do you have any specific control which you could suggest?
Uploadify in my opinion is the best.
Check out:
How do I get jQuery's Uploadify plugin to work with ASP.NET MVC?
its the same in mvc3.
file upload using ajax by retaining all the other information in the page.
I've used the ajaxForm plug-in for this, works pretty good (and is a pure JavaScript/jQuery solution).
asp.net mvc file upload ajax post
How can I upload a file via ASP.NET MVC and show a progress bar?
http://www.uploadify.com/
hope this helps