asp.net – every insert cshtml page getting same error

I have 4 model class in my project. Every model class has insert page. In my every insert data page, I am getting same error as “System.NullReferenceException“. This error is showing in each of @Html.EditorFor attribute.

Suppose, I have 3 input attributes in my insert data page (cshtml page), then in every attribute showing same error as “System.NullReferenceException“. I can not understand why is this happening? Please see the attached image. I can not debug this because errors are showing in cshtml pages. Please help I am going crazy with this error.

enter image description here

enter image description here

c# – Is it possible to access a parent row and then create multiple children from children .cshtml?

I have created a CRUD web app in which clients can use the functionalities to insert/update/delete data in two tables Header and Body. In Header I have a foreign key that is referencing Body_Id so it’s a one-to-many relationship.

Here I got stuck. I need to create a mechanism so when a client create or access a row from Header to have the possibility to create more Bodies from Body’s page.
Let me know if you need code.

Being a beginner I need to know if this is possible.
Thanks!

LE: I have created CRUD functionalities for both Header and Body, I just need to link these two pages. So, when I access a row from Header to have the possibility to add multiple children.

Como añadir un calendario a un campo input en javascript con .net y cshtml

Buen día, requiero añadir un calendario a mi campo input, actualmente tengo el siguiente código, uso cshtml y JavaScript con .NET.

En mi clase ModificacionFechasPagoPensiones.js, tengo el siguiente código:

/*Fecha Inicio*/
$("form#frmModificacionFechasPagoPensiones input(id='txtFechaInicio')").attr("data-validation", "custom, required, length");
$("form#frmModificacionFechasPagoPensiones input(id='txtFechaInicio')").attr("data-validation-length", "max10");
$("form#frmModificacionFechasPagoPensiones input(id='txtFechaInicio')").attr("maxlength", 10);
$("form#frmModificacionFechasPagoPensiones input(id='txtFechaInicio')").blur(function () {
    var FechaInicio = $(this).val();
    $(this).val(FechaInicio);
});
$("form#frmModificacionFechasPagoPensiones label(for='FechaInicio')").append("&nbsp;<span class='required' aria-required='true'>*</span>");

$("form#frmModificacionFechasPagoPensiones input(id='txtFechaInicio')").each(function (index) {

    $(this).attr("data-validation-error-msg-container", "#error_FechaInicio");
});

En mi clase ModificacionFechasPagoPensiones.cshtml, tengo el siguiente codigo:

<div class="space-4"></div>
                <div class="form-group">
                    @Html.LabelFor(model => model.FechaInicio, htmlAttributes: new { @class = "col-sm-3 control-label" })
                    <div class="col-sm-9">
                        @Html.TextBoxFor(model => model.FechaInicio, new { id = "txtFechaInicio", placeholder = "FechaInicio", @class = "form-control" })
                        <div id='error_FechaInicio' name='error_FechaInicio'>&nbsp;</div>
                    </div>
                </div>

@section Scripts {
  <script type="text/javascript">
   $(function () {
        $("#txtFechaInicio").datepicker();
    });
  </script>
}

asp.net core – Extension “IntelliSense for CSS class names in HTML” not work on file .cshtml

I create project MVC.Net Core by VSCode and VSCode have extension “IntelliSense for CSS class names in HTML”. The problem is when I type class like “btn btn-primary” IntelliSense not show, I have to press Ctrl+Spacebar everytime when I type class.
How to solve this problem?

asp.net mvc – HOW DO YOU DO IT? CONTROLLER – CSHTML

Good night

This is my CADController.cs file:

    // GET: CADCRUD/Create
    public ActionResult Create(){
        return View(new CADCRUD());
    }

    // POST: CADCRUD/Create
    (HttpPost)
    (ValidateAntiForgeryToken)
    public ActionResult INICIO(CADCRUD CDCRUD){
        CDCRUD.Salvar();
        return View();
    }

And I created a normal form with .cshtml and tried using these uses to restore the raw material from the controller side, but it didn't work:

– @using (Html.BeginForm ("CADMVC", "CADController", FormMethod.Get)) {}

– @using (Html.BeginForm ("START")) {}

Now I would like to call (assign) the save function of the CADController.cs page on my "Send" button. How do I do that? I tried to pass the input ID publicly: "ActionResult START (CADCRUD CDCRUD, String Save)", but the Save Crud was not assigned to the "Save" button either (I want to know how to do this this way, since I want to set the: delete button, select and update on the same page as the Save (Insert) button):

Input type = "submit" id = "save" name = "save" value = "SAVE"