Click here to Skip to main content
11,567,926 members (44,335 online)

.NET Framework

 
AnswerRe: Adding a flash webcam photo capture Pin
lhsunshine17-Dec-12 13:49
memberlhsunshine17-Dec-12 13:49 
AnswerRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 2:01
memberEddy Vluggen18-Dec-12 2:01 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 18:03
memberlhsunshine18-Dec-12 18:03 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine18-Dec-12 19:18
memberlhsunshine18-Dec-12 19:18 
GeneralRe: Adding a flash webcam photo capture Pin
Eddy Vluggen18-Dec-12 20:40
memberEddy Vluggen18-Dec-12 20:40 
GeneralRe: Adding a flash webcam photo capture Pin
lhsunshine19-Dec-12 2:28
memberlhsunshine19-Dec-12 2:28 
QuestionSplitting a url Pin
El daniel14-Dec-12 22:02
memberEl daniel14-Dec-12 22:02 
Questionpulling across value from list to display in view Pin
xnaLearner14-Dec-12 5:58
memberxnaLearner14-Dec-12 5:58 
Hey Guys...so trying to get my head around MVC

My Index for holiday page is linked to the model

@model HolidayBookingApp.Models.HolidayList
Im trying to pull the value of Holidays remaining from the HList4DD (HolidayListForDropDown) which is coming from the HolidayList.cs page.

I can get it through...

@foreach (var item in Model.HList4DD)
{
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.PersonId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.HolidayDate)
        </td>
        <td>
        @Html.DisplayFor(modelItem => item.Person.HolidaysRemaining)
        </td>
Although this displays the holidays remaining for every holiday booked. So if 20 holidays is the limit (4 booked and 16 remaining) this will produce a list of the dates of holidays booked i.e 4 records stating which date is booked, but it will show the '16' holidays remaining 4 times as well.

Yes, this is because it is inside the for loop but I tried to display it on its own and it didnt work

@Html.DisplayFor(model => model.HList4DD.//what do i add here?
Also tried to add

Person person = new Person();
            currentHolidaysRemaining = person.HolidaysRemaining; 
to the HolidayList. cs then in the view do
@Html.DisplayFor(model => model.currentHolidaysRemaining)
but its not pulling across the correct value, just returning 0

please advise....thanks
AnswerRe: pulling across value from list to display in view Pin
xnaLearner14-Dec-12 6:49
memberxnaLearner14-Dec-12 6:49 
AnswerRe: pulling across value from list to display in view Pin
frazzle-me14-Dec-12 17:41
memberfrazzle-me14-Dec-12 17:41 
GeneralRe: pulling across value from list to display in view Pin
xnaLearner15-Dec-12 8:28
memberxnaLearner15-Dec-12 8:28 
Questionproblem with relationships Pin
xnaLearner13-Dec-12 2:45
memberxnaLearner13-Dec-12 2:45 
AnswerRe: problem with relationships Pin
Richard Deeming13-Dec-12 3:48
memberRichard Deeming13-Dec-12 3:48 
GeneralRe: problem with relationships Pin
xnaLearner13-Dec-12 4:37
memberxnaLearner13-Dec-12 4:37 
Question[VB.NET 2008] DataSet and XML files Pin
steve_949661313-Dec-12 0:06
membersteve_949661313-Dec-12 0:06 
AnswerRe: [VB.NET 2008] DataSet and XML files Pin
Eddy Vluggen13-Dec-12 4:28
memberEddy Vluggen13-Dec-12 4:28 
GeneralRe: [VB.NET 2008] DataSet and XML files Pin
steve_949661313-Dec-12 21:21
membersteve_949661313-Dec-12 21:21 
GeneralRe: [VB.NET 2008] DataSet and XML files Pin
Eddy Vluggen14-Dec-12 0:34
memberEddy Vluggen14-Dec-12 0:34 
QuestionAssembly with different .NET framework versions Pin
marca29212-Dec-12 10:05
membermarca29212-Dec-12 10:05 
AnswerRe: Assembly with different .NET framework versions Pin
Gerry Schmitz12-Dec-12 12:25
memberGerry Schmitz12-Dec-12 12:25 
QuestionUse A Cookie To Send PersonID To Different Page Pin
xnaLearner12-Dec-12 4:33
memberxnaLearner12-Dec-12 4:33 
Questiondont allow user to select existing date Pin
xnaLearner10-Dec-12 5:46
memberxnaLearner10-Dec-12 5:46 
AnswerRe: dont allow user to select existing date Pin
Pete O'Hanlon10-Dec-12 5:53
protectorPete O'Hanlon10-Dec-12 5:53 
GeneralRe: dont allow user to select existing date Pin
xnaLearner10-Dec-12 6:23
memberxnaLearner10-Dec-12 6:23 
GeneralRe: dont allow user to select existing date Pin
xnaLearner10-Dec-12 23:26
memberxnaLearner10-Dec-12 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150624.2 | Last Updated 30 Jun 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid