So I have a basic CRUD I am working on, and Im trying to get Jquery validation working on it. I have it almost all set up except I need to give my form an id. I am using cshtml in visual studio and try to assign the id to the form using the following code:
@using (Html.BeginForm( new { id = "daftform" })) {
@Html.ValidationSummary(true)
<fieldset>
<legend>News</legend>
However the generated html looks like this:
<form action="/News/Create/daftform" method="post"> <fieldset>
<legend>News</legend>
I am pretty sure this is how to assign an id to an element as I use this method to assign classes in a similar way. Can anyone tell me where im going wrong?
I just want it to assign 'daftform' as an id not as an action.
Sorry if its a simple answer, fairly new to c#.