Tuesday, 10 September 2013

Submit form on my asp.net mvc view and the url does not show the controller and action.....How can those be shown?

Submit form on my asp.net mvc view and the url does not show the
controller and action.....How can those be shown?

Here is my form or an example of my form. :
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { id =
"indexForm" }))
{
<div>etc</div>
}
I then have a javascript function that will submit this form at distinct
times. :
$("#indexForm").submit();
The problem is that when I go to my application initially the url is this. :
http://myWebsite/myApplication/myController/myAction
After the form is submitted via javascript here is my url. :
http://myWebsite/myApplication/
Due to the routing that I have it navigates to my index action without
issue, but I really want that url to contain my controller and action.
Is this possible after the form is submitted?

No comments:

Post a Comment