Click here to Skip to main content
15,886,067 members
Home / Discussions / Web Development
   

Web Development

 
Questionconnecting to Oracle 11g database using PHP Pin
vln1514-Feb-13 0:10
vln1514-Feb-13 0:10 
QuestionNeed of Online Shopping sourcecode using JSP Pin
Member 981710712-Feb-13 22:04
Member 981710712-Feb-13 22:04 
AnswerRe: Need of Online Shopping sourcecode using JSP Pin
Richard MacCutchan12-Feb-13 22:29
mveRichard MacCutchan12-Feb-13 22:29 
AnswerRe: Need of Online Shopping sourcecode using JSP Pin
Steve Mayfield13-Feb-13 5:51
Steve Mayfield13-Feb-13 5:51 
QuestionProposals for a final internship studies Pin
simontifo12-Feb-13 13:31
simontifo12-Feb-13 13:31 
AnswerRe: Proposals for a final internship studies Pin
Jibesh12-Feb-13 14:30
professionalJibesh12-Feb-13 14:30 
GeneralRe: Proposals for a final internship studies Pin
simontifo28-Feb-13 19:47
simontifo28-Feb-13 19:47 
QuestionMVC: Pass List<> between View and Controller Pin
astuserp11-Feb-13 23:05
astuserp11-Feb-13 23:05 
Dear Fellow developer. I am a newbie in MVC. Recently I try to perform the following:

//--- Model
public class Skill
{
public bool IsSkill { get; set; }
public string SkillStr { get; set; }
}

public class PageModel
{
public string UserName { get; set; }
public string Address { get; set; }
public List<skill> skills { get; set; }
}

//---Controller
public ViewResult UpdateSkills(int id)
{
PageModel model = GetPageModel(id);
model.skills = GetSkills(id);
return View(model);
}

[HttpPost]
public ActionResult UpdateSkills(PageModel model)
{
if (ModelState.IsValid)
{
List<string> SkillStr = new List<string>();

// ERROR: model.skills null
foreach (Skill rw in model.skills)
{
if (rw.IsSkill)
{
SkillStr.Add(rw.SkillStr);
}
}
}
// ... Other code are omitted
}


//--- View


@foreach(Skill rw in Model.skills)
{
@Html.EditorFor(m => rw.IsSkill) @Html.DisplayFor(m => rw.SkillStr) }

Now, the question that I am wondering is why the List<skill> skills become null when it returns from the view, while it was passed with value before the view is shown.

Does anyone have any clue what I am missing? I really can not figure out why.
Thank you for any enlightenment that you may provide.
AnswerRe: MVC: Pass List<> between View and Controller Pin
Bram van Kampen22-Feb-13 15:16
Bram van Kampen22-Feb-13 15:16 
GeneralRe: MVC: Pass List<> between View and Controller Pin
astuserp24-Feb-13 15:20
astuserp24-Feb-13 15:20 
Questionweb development Pin
Smart0035-Feb-13 1:30
professionalSmart0035-Feb-13 1:30 
AnswerRe: web development Pin
Richard MacCutchan5-Feb-13 1:35
mveRichard MacCutchan5-Feb-13 1:35 
QuestionRe: web development Pin
Smart0037-Feb-13 0:55
professionalSmart0037-Feb-13 0:55 
AnswerRe: web development Pin
Richard MacCutchan7-Feb-13 1:32
mveRichard MacCutchan7-Feb-13 1:32 
AnswerRe: web development Pin
Sandeep Mewara5-Feb-13 2:26
mveSandeep Mewara5-Feb-13 2:26 
Questionweb development Pin
Smart0037-Feb-13 0:51
professionalSmart0037-Feb-13 0:51 
AnswerRe: web development Pin
Sandeep Mewara8-Feb-13 3:56
mveSandeep Mewara8-Feb-13 3:56 
AnswerRe: web development Pin
Rahul Rajat Singh5-Feb-13 19:21
professionalRahul Rajat Singh5-Feb-13 19:21 
Questionweb development Pin
Smart0037-Feb-13 0:53
professionalSmart0037-Feb-13 0:53 
AnswerRe: web development Pin
Rahul Rajat Singh7-Feb-13 17:35
professionalRahul Rajat Singh7-Feb-13 17:35 
Generalweb development Pin
Smart0038-Feb-13 0:39
professionalSmart0038-Feb-13 0:39 
QuestionDynamic Website Deployment in IIS 6 Pin
dihnekhs_gr4-Feb-13 3:07
dihnekhs_gr4-Feb-13 3:07 
QuestionExport to excel Pin
Balaji Bethala3-Feb-13 23:03
Balaji Bethala3-Feb-13 23:03 
QuestionDataSet Pin
Abdulla_M3-Feb-13 21:01
Abdulla_M3-Feb-13 21:01 
AnswerRe: DataSet Pin
Sandeep Mewara3-Feb-13 21:38
mveSandeep Mewara3-Feb-13 21:38 

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.