Search

You searched for the word(s): userid:291752

Matching Posts

  • Re: ASP.NET MVC 2 Beta Default Model Binder / Validation

    I appreciate you looking into this!
    Posted to ASP.NET MVC (Forum) by rdahbura on 11/20/2009
  • Bug ASP.NET MVC 2 Beta Default Model Binder

    After switching to the MVC 2 Beta release, I began to experience a change in the behavior of the validation process for IDataErrorInfo models. A full description is listed on: http://stackoverflow.com/questions/1760765/asp-net-mvc-2-beta-default-model-binder Please help.
    Posted to ASP.NET MVC (Forum) by rdahbura on 11/20/2009
    Filed under: asp.net mvc c#
  • Re: ASP.NET MVC ModelBinders and IDataErrorInfo

    I think I've figured it out. Apparently the DefaultModelBinder recursively binds everything and I missed the final step in the recursion. Once it gets down to the simple properties, it binds them and adds their keys to the ModeState object... something like this: bindingContext.ModelState.SetModelValue(modelStateKey, valueProviderResult); That's what was missing so on the view being rendered, the helper finds the key, regardless of whether there was a value or whether it was blank.
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/21/2009
  • Re: ASP.NET MVC ModelBinders and IDataErrorInfo

    Here's the controller method stub... public ActionResult Index(Oq_Lead lead) { ... } Here's the model binder I'm using... namespace OfficialQuote.GlobeLife.Framework.Binders { using System; using System.Web; using System.Web.Mvc; using OfficialQuote.GlobeLife.Framework.Models.LinqToSql; public class LeadBinder : BinderBase { public LeadBinder() { } public override object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext) { if (controllerContext == null
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/21/2009
  • Re: ASP.NET MVC ModelBinders and IDataErrorInfo

    I've got something similar going on. The controller parameter I'm looking to bind implements IDataErrorInfo and the custom binder is picking up the values from the posted form. The problem I'm having is populating the ModelState object with the errors from the IDataErrorInfo class, which takes place during the bind. For example, I have a drop down list and I leave it's value blank, on the post, the Html.DropDownList throws an exception. I believe it's looking for a ModelState
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/21/2009
  • ASP.NET MVC ModelBinders and IDataErrorInfo

    When writing my own model binder, how do I make sure classes that implement IDataErrorInfo get validated and the results get added correctly to the model so the validation messages appear correctly? After looking through the DefaultModelBinder, it appears to handle that. Thanks.
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/21/2009
    Filed under: "ASP.NET MVC"
  • Re: ASP.NET Action Filter

    Perfect! Works like a charm. Thank you.
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/16/2009
  • ASP.NET Action Filter

    I'm writing an ASP.NET MVC based wizard and in order for the wizard to function correctly I need to verify that a particular object exists in the session. This is necessary from an application functionality perspective as well as a user experience perspective. The wizard needs the object and the user shouldn't see an ugly error if they bookmark a Wizard URL and come back to it later. My approach is to use an action filter. In principle, this would be similar to the authorization filter. I'm
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/16/2009
    Filed under: ASP.NET MVC
  • Re: ASP.NET MVC and Radio Buttons

    Ok, I understand. For some reason I thought the radio button was similar to the text box whereby it seems to be bound by the helper. I extended my model to the view and things look good. Thanks!
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/13/2009
  • ASP.NET MVC and Radio Buttons

    I'm trying to create a list of yes/no questions using radio buttons. Creating the questions is no problem. The user selects whether they want to answer yes or no. The user then submits the form to the controller. Questions where the user doesn't make a choice are flagged as required and the form is shown again with error messages. However, those where a choice was made aren't repopulated with the choice, unlike other html elements. Here's my code... <ul class="sc-question
    Posted to ASP.NET MVC (Forum) by rdahbura on 4/13/2009
    Filed under: "ASP.NET MVC"
Page 1 of 3 (30 items) 1 2 3 Next >