Search Results

Search found 2 results on 1 pages for 'chrisb'.

Page 1/1 | 1 

  • Would you make use of "Google 20%" time if your employer encouraged and funded it?

    - by ChrisB
    We know about Google's 20% projects, whereby a developer can spend up to 20% of their time on a personal project which interests them. If your employer let you spend 20% of your time on a project that wasn't part of your day-to-day work, would you make use of it? I can think of a couple of reasons why not: It would make your normal work take 20% longer (extended deadline) You might want to keep your personal idea "personal."

    Read the article

  • ASP.NET MVC - Html.DropDownList - Value not set via ViewData.Model

    - by chrisb
    Have just started playing with ASP.NET MVC and have stumbled over the following situation. It feels a lot like a bug but if its not, an explanation would be appreciated :) The View contains pretty basic stuff <%=Html.DropDownList("MyList", ViewData["MyListItems"] as SelectList)%> <%=Html.TextBox("MyTextBox")%> When not using a model, the value and selected item are set as expected: //works fine public ActionResult MyAction(){ ViewData["MyListItems"] = new SelectList(items, "Value", "Text"); //items is an ienumerable of {Value="XXX", Text="YYY"} ViewData["MyList"] = "XXX"; //set the selected item to be the one with value 'XXX' ViewData["MyTextBox"] = "ABC"; //sets textbox value to 'ABC' return View(); } But when trying to load via a model, the textbox has the value set as expected, but the dropdown doesnt get a selected item set. //doesnt work public ActionResult MyAction(){ ViewData["MyListItems"] = new SelectList(items, "Value", "Text"); //items is an ienumerable of {Value="XXX", Text="YYY"} var model = new { MyList = "XXX", //set the selected item to be the one with value 'XXX' MyTextBox = "ABC" //sets textbox value to 'ABC' } return View(model); } Any ideas? My current thoughts on it are that perhaps when using a model, we're restricted to setting the selected item on the SelectList constructor instead of using the viewdata (which works fine) and passing the selectlist in with the model - which would have the benefit of cleaning the code up a little - I'm just wondering why this method doesnt work.... Many thanks for any suggestions

    Read the article

1