Last active
September 4, 2017 22:57
-
-
Save ad-m/21ba1d607cf9a34dd1c6a284db5e2520 to your computer and use it in GitHub Desktop.
ASP.Net Cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // both POST and GET | |
| ViewBag.SaleSelect = new SelectList(db.Salas, "ID", "NrSali"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Required] | |
| public int SalaId { get; set; } | |
| [Display(Name = "Sala")] | |
| public virtual Sala Sala { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="form-group"> | |
| @Html.LabelFor(model => model.Sala, htmlAttributes: new { @class = "control-label col-md-2" }) | |
| <div class="col-md-10"> | |
| @Html.DropDownListFor(x => x.SalaId, (IEnumerable<SelectListItem>)ViewBag.SaleSelect, new { @class = "form-control" }) | |
| @Html.ValidationMessageFor(model => model.Sala, "", new { @class = "text-danger" }) | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Html.ActionLink(Model.Seminarium.Tytul, "Details", "Seminariums", new { id = Model.Seminarium.ID }, null) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Html.TextAreaFor(model => model.Abstrakt, new { @class = "form-control" }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment