Click here to Skip to main content
14,689,507 members
Home » Discussions » ASP.NET
   

ASP.NET

 
GeneralRe: EntityFramework: Can we minimize sorting code Pin
Mou_kol7-Feb-18 21:40
MemberMou_kol7-Feb-18 21:40 
GeneralRe: EntityFramework: Can we minimize sorting code Pin
Richard Deeming8-Feb-18 2:39
mveRichard Deeming8-Feb-18 2:39 
GeneralRe: EntityFramework: Can we minimize sorting code Pin
Mou_kol8-Feb-18 2:52
MemberMou_kol8-Feb-18 2:52 
GeneralRe: EntityFramework: Can we minimize sorting code Pin
Richard Deeming8-Feb-18 2:58
mveRichard Deeming8-Feb-18 2:58 
QuestionAny free health monitoring dashboard exist Pin
Mou_kol5-Feb-18 23:00
MemberMou_kol5-Feb-18 23:00 
AnswerRe: Any free health monitoring dashboard exist Pin
Richard MacCutchan6-Feb-18 0:29
mveRichard MacCutchan6-Feb-18 0:29 
QuestionSending a collection of objects to the view in MVC Pin
Davstr5-Feb-18 5:42
MemberDavstr5-Feb-18 5:42 
AnswerRe: Sending a collection of objects to the view in MVC Pin
Richard Deeming5-Feb-18 9:25
mveRichard Deeming5-Feb-18 9:25 
You're looping through the rooms, but you're overwriting the EastSouth list each time.

You're also passing a string as the only parameter to the SelectList constructor. This will call the SelectList(IEnumerable)[^] overload, which will create a list item for each character in the string.

Change your code to pass the list of rooms to the SelectList constructor, along with the name of the property which contains the value and the text:
var AvailRoom = db.Rooms
    .Where(s => s.IsOccupied == false)
    .Where(s => s.RoomNum > 101 && s.RoomNum < 126)
;

ViewBag.EastSouth = new SelectList(AvailRoom, "RoomNum", "RoomNum");




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Sending a collection of objects to the view in MVC Pin
Davstr5-Feb-18 19:24
MemberDavstr5-Feb-18 19:24 
QuestionASP.Net MVC:clicking on routelink url not passing all the data to action Pin
Mou_kol5-Feb-18 4:50
MemberMou_kol5-Feb-18 4:50 
AnswerRe: ASP.Net MVC:clicking on routelink url not passing all the data to action Pin
Richard Deeming5-Feb-18 9:17
mveRichard Deeming5-Feb-18 9:17 
GeneralRe: ASP.Net MVC:clicking on routelink url not passing all the data to action Pin
Mou_kol5-Feb-18 22:56
MemberMou_kol5-Feb-18 22:56 
QuestionHow to calculate page no for newly inserted records Pin
Mou_kol5-Feb-18 3:54
MemberMou_kol5-Feb-18 3:54 
AnswerRe: How to calculate page no for newly inserted records Pin
Maciej Los5-Feb-18 4:23
mveMaciej Los5-Feb-18 4:23 
Questionasp.net mvc routing with two controller reference Pin
Mou_kol5-Feb-18 2:18
MemberMou_kol5-Feb-18 2:18 
AnswerRe: asp.net mvc routing with two controller reference Pin
Richard Deeming5-Feb-18 9:09
mveRichard Deeming5-Feb-18 9:09 
GeneralRe: asp.net mvc routing with two controller reference Pin
Mou_kol5-Feb-18 22:54
MemberMou_kol5-Feb-18 22:54 
GeneralRe: asp.net mvc routing with two controller reference Pin
Richard Deeming6-Feb-18 3:11
mveRichard Deeming6-Feb-18 3:11 
GeneralRe: asp.net mvc routing with two controller reference Pin
Mou_kol6-Feb-18 3:38
MemberMou_kol6-Feb-18 3:38 
GeneralRe: asp.net mvc routing with two controller reference Pin
Richard Deeming6-Feb-18 3:50
mveRichard Deeming6-Feb-18 3:50 
QuestionWhat is Kubernetes and its usage Pin
Mou_kol4-Feb-18 23:11
MemberMou_kol4-Feb-18 23:11 
AnswerRe: What is Kubernetes and its usage Pin
Richard MacCutchan5-Feb-18 0:04
mveRichard MacCutchan5-Feb-18 0:04 
GeneralRe: What is Kubernetes and its usage Pin
Mou_kol5-Feb-18 1:36
MemberMou_kol5-Feb-18 1:36 
GeneralRe: What is Kubernetes and its usage Pin
Richard MacCutchan5-Feb-18 1:42
mveRichard MacCutchan5-Feb-18 1:42 
Questionwhat is needed to create a payment getway? Pin
Ayrton Yagami2-Feb-18 7:34
MemberAyrton Yagami2-Feb-18 7:34 

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

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