Skip to content
Loading
Sweet Alert message in ASP.NET CORE MVC    
  •                             
  •     
  •                         class="form-group row">    
  •                             for="Jenis_Kelamin" class="col-sm-2 col-form-label"> Jenis Kelamin    
  •                             class="col-sm-10">    
  •                                 @Html.RadioButtonFor(model => model.Jenis_Kelamin, "Laki-Laki"Laki-Laki    
  •                                 @Html.RadioButtonFor(model => model.Jenis_Kelamin, "Perempuan"Perempuan    
  •                                     
  •                                 for="Jenis_Kelamin" id="Jenis_Kelamin" class="text-danger">    
  •                                 
  •                             
  •     
  •                         class="form-group row">    
  •                             for="Spesialisasi" class="col-sm-2 col-form-label">Spesialisasi    
  •                             class="col-sm-10">    
  •                                 for="Spesialisasi" id="Spesialisasi" class="form-control" placeholder="Spesialisasi">    
  •                                 for="Spesialisasi" class="text-danger">    
  •                                 
  •                             
  •     
  •                         class="form-group row">    
  •                             for="Keahlian" class="col-sm-2 col-form-label">Keahlian    
  •                             class="col-sm-10">    
  •                                 for="Keahlian" id="Keahlian" class="form-control" rows="4" placeholder="Keahlian">    
  •                                 for="Keahlian" class="text-danger">    
  •                                 
  •                             
  •     
  •                         class="form-group row">    
  •                             class="col-sm-2 col-form-label">    
  •                             class="col-sm-10">    
  •                                 "submit" class="btn btn-success"> Save Data    
  •                                 
  •                             
  •                     
  •                 
  •                 
  •             
        
  •                 "Index" class="btn btn-success">class="fa fa-arrow-back">  Back to List     
  •                 
  •             
  •        
  • this is the Index.cshtml
    1. @*    
    2.     For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860    
    3. *@    
    4. @*@model AdminLTEMvc.Models.DokterModel*@    
    5. @{    
    6.     Layout = "~/Views/Shared/AdminLayout.cshtml";    
    7. }    
    8. @model System.Data.DataTable    
    9. "~/plugins/fontawesome-free/css/all.css" rel="stylesheet" />    
    10.     
    11. class="content">    
    12.     class="container-fluid">    
    13.         
          
    14.             "TambahData">class="fa fa-plus-square btn btn-success"> Tambah Data    
    15.         
        
  •             
  •         class="table table-bordered table-responsive-lg table-hover" width="100%" id="myTable">    
  •             class="thead-dark text-center">    
  •                     
  •                         
  •                         Nama Dokter    
  •                         
  •                         
  •                         Alamat    
  •                         
  •                         
  •                         Jenis Kelamin    
  •                         
  •                         
  •                         Spesialisasi    
  •                         
  •                         
  •                         Keahlian    
  •                         
  •                         
  •                         Action    
  •                         
  •                     
  •                 
  •             class="text-center">    
  •                 @for (int i = 0; i < Model.Rows.Count; i++)    
  •                 {    
  •                         
  •                             
  •                             @Model.Rows[i]["Nama_Dokter"]    
  •                             
  •                             
  •                             @Model.Rows[i]["Alamat"]    
  •                             
  •                             
  •                             @Model.Rows[i]["Jenis_Kelamin"]    
  •                             
  •                             
  •                             @Model.Rows[i]["Spesialisasi"]    
  •                             
  •                             
  •                             @Model.Rows[i]["Keahlian"]    
  •                             
  •                             
  •                             "UpdateData" asp-route-id="@Model.Rows[i]["Id_Dokter"]">class="fa fa-edit btn btn-sm btn btn-info"> Edit  |    
  •                             "Delete" asp-route-id="@Model.Rows[i]["Id_Dokter"]">class="fa fa-trash btn btn-sm btn btn-danger"> Delete     
  •                             
  •                         
  •                 }    
  •                 
  •             
  •         
  •     
  •         
  •     "~/plugins/jquery/jquery.min.js">    
  •     "~/plugins/datatables/jquery.dataTables.min.css" rel="stylesheet" />    
  •     "~/plugins/datatables/jquery.dataTables.js">    
  •     
  •     "text/javascript" language="javascript">    
  •         $(document).ready(function () {    
  •             $("#myTable").DataTable(    
  •                 {    
  •                     bLengthChange: true,    
  •                     lengthMenu: [[5, 10, 25, 50, 100], [5, 10, 25, 50, 100]],    
  •                     bFilter: true,    
  •                     bSort: true,    
  •                     bPaginate: true    
  •                 })    
  •         })    
  •         
  •   
  • 3 Replies

    Know the answer? Post it — somebody with the same question will find it here.