(MVC5) Strange problem. In one view, I POST to 'testpage' with:
<form id="testbtn" method="post" action='http://localhost:11704/Home/testpage'>
<input type='submit' value="local testing" />
@Html.Hidden("key1", "value1")
@Html.Hidden("key2", "value2")
@Html.Hidden("key3", "value3")
@Html.Hidden("key4", "value4")
</form>
The 'testpage' controller action is:
<HttpPost>
Function testpage(formdata As FormCollection) As ActionResult
Dim newdata As New StringBuilder()
For Each dataitem In formdata.Keys
newdata.Append(dataitem.ToString()).Append(" ")
newdata.Append(formdata(dataitem.ToString()))
newdata.AppendLine()
Next
ViewBag.message = newdata
Return View()
End Function
And when I use "view source" for the displayed 'testpage' I can see this:
<br />
key1 value1
key2 value2
key3 value3
key4 value4
But that is displayed in the browser like this:
key1 value1 key2 value2 key3 value3 key4 value4
Any ideas why the new lines evidently included in my viewbag are not showing up on screen?
Thanks.
Best Regards, Alan
") – Stephen Sugumar Nov 11 '14 at 16:23