May be having jQuery or JavaScript loading -
i trying style textbox , layout using bootstrap class, getting error message , bootstrap class didn't work properly.
you can review code error image below. solution?
here uploading code , error image:
@model drivein.models.usersmodel <script src="~/scripts/jquery-3.1.0.min.js"></script> <script src="~/scripts/jquery.validate.min.js"></script> <script src="~/scripts/jquery.validate.unobtrusive.min.js"></script> @using (html.beginform()) { @html.antiforgerytoken() @html.validationsummary(true) <div class="form-group"> @html.labelfor(model => model.username, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.editorfor(model => model.username, new { htmlattributes = new { @class = "form-control" } }) @html.validationmessagefor(model => model.username, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @html.labelfor(model => model.fk_roleid, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.editorfor(model => model.fk_roleid, new { htmlattributes = new { @class = "form-control" } }) @html.validationmessagefor(model => model.fk_roleid, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @html.labelfor(model => model.password, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.editorfor(model => model.password, new { htmlattributes = new { @class = "form-control" } }) @html.validationmessagefor(model => model.password, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> @html.labelfor(model => model.confirmpassword, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.editorfor(model => model.confirmpassword, new { htmlattributes = new { @class = "form-control" } }) @html.validationmessagefor(model => model.confirmpassword, "", new { @class = "text-danger" }) </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" value="save" class="btn btn-default" /> </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10" style="color:green"> @viewbag.message </div> </div> } <div> @html.actionlink("back list", "getallusers") </div>
(asp.net mvc 4)
try replacing reference scripts following (it may work):
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <!-- jquery library --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <!-- latest compiled javascript --> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
Comments
Post a Comment