Skip to main content
Relanzada por el usuario Comunidad
Relanzada por el usuario Comunidad
Relanzada por el usuario Comunidad
corregido titulo
Enlace
devconcept
  • 12.8k
  • 3
  • 42
  • 57

¿Cómo deshabilitar controles de un login creado en MVC al hacer submit?

etiquetas editadas
Enlace
devconcept
  • 12.8k
  • 3
  • 42
  • 57
Corregido codigo
Origen Enlace
devconcept
  • 12.8k
  • 3
  • 42
  • 57
@model CFD_FNE.Models.LoginModels
@{
    ViewBag.Title = "Sign @modelIn";
}
<br CFD_FNE/>
<br />
<h2>Sign In</h2>

@using (Html.ModelsBeginForm()) 
{
    @Html.LoginModelsAntiForgeryToken()

@{ ViewBag.Title = "Sign In"; }

Sign In

@using (Html.BeginForm()) { @Html.AntiForgeryToken()


@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.Correo, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.EditorFor(model => model.Correo, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Correo, "", new { @class = "text-danger" })

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

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

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

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" id="btnLogin" value="Aceptar" class="btn btn-default" />
            </div>
        </div>
    </div>
</section>
}

@Scripts.Render("~/bundles/jquery-1.12.3.min")
@Scripts.Render("~/bundles/jquery.validate.min")
@Scripts.Render("~/bundles/jquery.validate.unobtrusive.min")
@Scripts.Render("~/bundles/JSFunciones")

}

@Scripts.Render("~/bundles/jquery-1.12.3.min") @Scripts.Render("~/bundles/jquery.validate.min") @Scripts.Render("~/bundles/jquery.validate.unobtrusive.min") @Scripts.Render("~/bundles/JSFunciones")

        @model CFD_FNE.Models.LoginModels

@{ ViewBag.Title = "Sign In"; }

Sign In

@using (Html.BeginForm()) { @Html.AntiForgeryToken()


@Html.ValidationSummary(true, "", new { @class = "text-danger" }) @Html.LabelFor(model => model.Correo, htmlAttributes: new { @class = "control-label col-md-2" }) @Html.EditorFor(model => model.Correo, new { htmlAttributes = new { @class = "form-control" } }) @Html.ValidationMessageFor(model => model.Correo, "", new { @class = "text-danger" })

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

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

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" id="btnLogin" value="Aceptar" class="btn btn-default" />
            </div>
        </div>
    </div>
</section>

}

@Scripts.Render("~/bundles/jquery-1.12.3.min") @Scripts.Render("~/bundles/jquery.validate.min") @Scripts.Render("~/bundles/jquery.validate.unobtrusive.min") @Scripts.Render("~/bundles/JSFunciones")

@model CFD_FNE.Models.LoginModels
@{
    ViewBag.Title = "Sign In";
}
<br />
<br />
<h2>Sign In</h2>

@using (Html.BeginForm()) 
{
    @Html.AntiForgeryToken()
    <section>
    <div class="form-horizontal">
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group">
            @Html.LabelFor(model => model.Correo, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.Correo, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.Correo, "", new { @class = "text-danger" })
            </div>
        </div>

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

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

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" id="btnLogin" value="Aceptar" class="btn btn-default" />
            </div>
        </div>
    </div>
</section>
}

@Scripts.Render("~/bundles/jquery-1.12.3.min")
@Scripts.Render("~/bundles/jquery.validate.min")
@Scripts.Render("~/bundles/jquery.validate.unobtrusive.min")
@Scripts.Render("~/bundles/JSFunciones")
se añadieron 1026 caracteres en el cuerpo
Origen Enlace
Arthur
  • 43
  • 1
  • 7
Loading
Corregidas las etiquetas y eliminado texto de agradecimiento de la pregunta
Origen Enlace
devconcept
  • 12.8k
  • 3
  • 42
  • 57
Loading
Se comenta lenguaje y se agrega código de servidor (C#) y cliente (razor).
Origen Enlace
Arthur
  • 43
  • 1
  • 7
Loading
Origen Enlace
Arthur
  • 43
  • 1
  • 7
Loading