vendredi 26 juin 2015

Adding an item to a table in MVC

I have created a table of comments and in a separate view I want to add comments.

I made this code in that view:

<form action="#" method="post">
    <h3>Post a comment</h3>
    <h1>
        <label for="Title">Title</label>
        <input name="Title" id="Title" type="text" required />
    </h1>
    <h1>
        <label for="Text">Text</label>
        <input name="Text" id="Text" type="text" required />
    </h1>
    <h1>
        <label for="AuthorSite">AuthorSite</label>
        <input name="AuthorSite" id="AuthorSite" required />
    </h1>
    <h1>
        <label for="Author">Author</label>
        <input name="Author" id="Author" type="text" required/>
    </h1>
    <input type="submit" value="Post comment" onclick=""@Url.Action("Index", "Home")"/>
</form>

I have no idea what to do in the button when I want to add that information to the table.

Aucun commentaire:

Enregistrer un commentaire