Click here to Skip to main content
15,914,163 members

Comments by AMADIAR (Top 4 by date)

AMADIAR 13-Aug-13 5:32am View    
Hi David,
Thank you so much for your help. It's working fine.
AMADIAR 2-Jul-13 2:56am View    
Hi Denis,
Thank you for your suggestion. In My controller I made one option with its property selected as you suggested and it worked fine. Thank you once again for your help.
AMADIAR 20-Jun-13 2:45am View    
Hi saguptamca,
Thank you so much for your suggestion. I added a primary key and It worked fine.
AMADIAR 19-Jun-13 5:55am View    
This is my model class
public class StaffAppointment
{
public Int32 StaffNo { get; set; }
public DateTime DateBooked { get; set; }
public Nullable<int> TimeTo { get; set; }
public Nullable<int> TimeFrom { get; set; }
}
and My View
@model IEnumerable<myapp.models.staffappointment>

@{
ViewBag.Title = "AddAppointment";
}


<table>
<tr>
<th>
Staff no
</th>
<th>
DateBooked
</th>
<th>
TimeFrom
</th>
<th>
TimeTo
</th>
<th></th>
</tr>

@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item. Staffno)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateBooked)
</td>

<td>
@Html.DisplayFor(modelItem => item.TimeFrom)
</td>
<td>
@Html.DisplayFor(modelItem => item.TimeTo)
</td>

</tr>
}

</table>