Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
May 04, 2012 08:14 AM|LINK
I am new to this community and I downloaded and installed the MVC4 along with the Web API template.
Then, I created a new solution with the Web Api template.
I created a new Controller and View, which is basically a html page which contains a form which creates a Post towards another Controller, which is basically a copy of the ValuesController, which is created when selecting the Web API Template of the MVC4
The code of the html looks like this:
Layout = null;
<!-- <meta name="viewport" content="width=device-width" /> -->
<form action="http://localhost/MyController/api/MyController" enctype="text/html" method="post" target="result">
POST data: <br />
<textarea name="person" cols="100" rows="20"></textarea>
<input type="submit" value="Submit" /> <br /><br />
<a href="http://localhost/MyController/api/MyController" target="result">Get resource</a> <br /><br />
<iframe name="result" width="1000px" />
When I click the submit button a download window is shown and immediately an error is raised saying that the download failed. But I only wanted to create a post and possible feedback shown in the iframe named result, which is set as target attribute in the
I tried to modify the Post Method with a return value of HttpResponseMessage and the sample with void, both show the exact behavior.
I don't know where the problem might be. Maybe someone had the same issue and resolved it? Or any suggestion?
Thanks in advance