2016-08-29 16 views
0

Bootstrapクラスを使用してテキストボックスとレイアウトのスタイルを設定しようとしていますが、エラーメッセージが表示され、Bootstrapクラスが正しく機能しませんでした。jQueryまたはJavaScriptがロードされている可能性があります

以下のコードとエラーイメージを確認できます。 解決策は何ですか?

ここで私はすべてのコードとエラー画像をアップロードしています:

This is the error

@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 to List", "GetAllUsers") 
 
</div>

ASP.NET MVC 4)

答えて

1

以下で参照スクリプトを交換してみてください(それ動作する可能性があります):

<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> 
+0

ありがとうございます! –

+0

あなたは私の友人です! –

関連する問題