I am doing a tutorial that uses the mvc. I have the following view:
Index.aspx
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MovieApp.Models.Movie>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Index</h2>
<form action="Movie/List" method="post">
<table>
<tr>
<td>
<button id="List" type="button" onclick="">List</button>
</td>
</tr>
</table>
</form>
<form action="Create.aspx" method="post">
<table>
<tr>
<td>
<input type="submit" value="Create" />
</td>
</tr>
</table>
</form>
</asp:Content>
so when you click on create it must call the Create view.
when i run the app i get an error: Resource cannot be found. Create.aspx a view in the movie folder.
What is the path that I need to specify for the Create.aspx to be found?
You shouldn’t be pointing to the page, Create.aspx. You should be pointing to a method called Create in a controller.
Its not clear on any controller you are using, but by default it will post to its own controller (with the same name). Or you can specify the method and controller to post to like this, using Html.BeginFrom: