Dear all,
Compliment of the season, I am prety new to ASP.NET MVC but when through some tutorials and i am able to get my fingers on it step by step.
I have some issue with the displaying my records in rows below is my code from the Index.cshtml
- @model System.Data.DataTable
- @{
- ViewBag.Title = "Index";
- }
class="table table-bordered table-striped table-responsive">
First Name Last Name Other Name Email Address B Month Martal Status Member Status - Edit
- Delete
- @for (int i = 0; i < Model.Rows.Count; i++)
- {
@Model.Rows[i][1] @Model.Rows[i][2] @Model.Rows[i][3] @Model.Rows[i][4] @Model.Rows[i][5] @Model.Rows[i][6] @Model.Rows[i][7] @Model.Rows[i][8] class="btn btn-primary" href="@Url.Action("Edit", "Member", new {@[email protected][i][0] })" >Edit class="btn btn-danger" href="@Url.Action("Delete", "Member", new {@[email protected][i][0] })">Delete - }
- "@Url.Action("Create","Member")" class="btn btn-sm btn-primary">Add Member
- @* onclick="location.href='@Url.Action("YourActionName", "YourControllerName")'">Submit*@
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace HIGHGROUNDMCV.Models
- {
- public class MembersModel
- {
- public int ID { get; set; }
- [DisplayName("First Name")]
- public string FName { get; set; }
- [DisplayName("Last Name")]
- public string LName { get; set; }
- [DisplayName("Other Name")]
- public string OName { get; set; }
- public string Email { get; set; }
- public string Address { get; set; }
- [DisplayName("Month of Birth")]
- public int MOB { get; set; }
- [DisplayName("Marital Status")]
- public string MStatus { get; set; }
- [DisplayName("Member Status")]
- public string MembStatus { get; set; }
- }
- }

I want the records to show in rows all show in a single row, please what am i doing wrong.
thank you for your help

Amit KumarPosted Dec 20, 2017, 2:46 PM
Amit KumarPosted Dec 21, 2017, 2:12 AM
Dharmraj ThakurPosted Dec 21, 2017, 12:15 AM
Abraham OlatubosunPosted Dec 20, 2017, 3:19 PM