Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am using EntityFramework 2013 with Razors.

i want to put date element and drop downlist in my CShtml of view in MVC5.
below is the my code
HTML
<div class="form-group">
          @Html.LabelFor(model => model.AllocationDate, htmlAttributes: new { @class = "control-label col-md-2" })
          <div class="col-md-10">
              @Html.EditorFor(model => model.AllocationDate, new { htmlAttributes = new { @class = "form-control" } })
              @Html.ValidationMessageFor(model => model.AllocationDate, "", new { @class = "text-danger" })
          </div>
      </div>

      <div class="form-group">
          @Html.LabelFor(model => model.PortORterminal, htmlAttributes: new { @class = "control-label col-md-2" })
          <div class="col-md-10">
              @Html.EditorFor(model => model.PortORterminal, new { htmlAttributes = new { @class = "form-control" } })
              @Html.ValidationMessageFor(model => model.PortORterminal, "", new { @class = "text-danger" })
          </div>
      </div>

      <div class="form-group">
          @Html.LabelFor(model => model.CurrentDestination, htmlAttributes: new { @class = "control-label col-md-2" })
          <div class="col-md-10">
              @Html.EditorFor(model => model.CurrentDestination, new { htmlAttributes = new { @class = "form-control" } })
              @Html.ValidationMessageFor(model => model.CurrentDestination, "", new { @class = "text-danger" })
          </div>
      </div>
Posted
Updated 2-Mar-15 8:51am
v2
Comments
Afzaal Ahmad Zeeshan 2-Mar-15 15:18pm    
What actually is the problem?
naresh raju 2-Mar-15 21:14pm    
above code return to me textbox to enter the date.
but i need to datebox (if i change into date by manually showing unexpected error).
in the same i want to provide drop downlist instead of nother text box.
Allocationdate= date element(but above code shows text area element)
CurrentDestination= dropdownlist(but above code shows text area).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900