Hallo zusammen,
ich baue gerade eine Webanwendung mit ASP.Net MVC 3 und Razor.
Das ist mein erstes Projekt und ich habe ein Problem wo ich nicht weite komme.
Ich habe ein Formular, dass mir Datensätze in einer SQL DB anlegen soll. Hier gibt es zwei Felder die Automatisch befüllt werden sollen
Ersteller = Benutzername und
Erstellt = aktuelles Datum und Uhrzeit.
@model Adgaptool.Models.AdGap
@{
ViewBag.Title = "Create";
}
<h2>Erstellen</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>New UCam ID</legend>
<div class="editor-label">
@Html.LabelFor(model => model.Bezeichnung)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Bezeichnung)
@Html.ValidationMessageFor(model => model.Bezeichnung)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.erstellt)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.erstellt)
@Html.ValidationMessageFor(model => model.erstellt)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.ersteller)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.ersteller)
@Html.ValidationMessageFor(model => model.ersteller)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.AdvertiserID_f, "Kunde")
</div>
<div class="editor-field">
@Html.DropDownList("AdvertiserID_f", String.Empty)
@Html.ValidationMessageFor(model => model.AdvertiserID_f)
</div>
<p>
<input type="submit" value="Create" name="Erstellen" style="background-color: #008000" />
</p>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
Könnt ihr mir dabei helfen?
Beste Grüße
Andy