Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:291752
More Search Options
RSS Available
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 >
ASP.NET:
Death to confirmation dialogs with jquery.undoable
Channel 9:
E2E: Brian Beckman and Erik Meijer - Co/Contravariance in Physics and Programming, 1 of 2
TechNet Edge:
Windows Server 2008 R2 Quick Look #3 - PowerShell V2
ASP.NET:
2009 Blogged - Greatest Hits
WindowsClient:
2009 Blogged - Greatest Hits
Channel 9:
Nikolaj Bjørner and Leonardo de Moura: The Z3 Constraint Solver
Channel 9:
MEF & Silverlight 4 Beta - Part 2, Imports & Exports
Channel 9:
MEF & Silverlight 4 Beta - Part 1, Introduction
WindowsClient:
The (Near) Final Word on Multi-Monitor Taskbars for Windows 7 - Ultramon vs. DisplayFusion
WindowsClient:
Looking back at 2009, and forward to 2010
Silverlight:
Polling Video – A Viable sub-second alternative?
TechNet Edge:
Windows Server 2008 R2 Quick Look #2 - Active Directory Recycle Bin
Channel 10:
I'm a Windows 7 PC Themes
Channel 10:
24 Years of Windows Box Art
WindowsClient:
Silverlight tutorial: HOW TO build CommandLink Control in Silverlight with Expression Blend 3 and Behaviors
ASP.NET:
Converting an RGB Color To Hex With JavaScript
Silverlight:
Silverlight HVP Design – Configuration & Scenarios
Channel 9:
Channel 9 Live at PDC09: Day 3 Welcome
Channel 9:
Channel 9 Live at PDC09: TWoC9 Day 3
Channel 10:
Microsoft's Mobicast: Stiched Cell Streams
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online