PDA

View Full Version : Specified cast is not valid / Bidirectional data binding


wmopnc
05-11-2005, 11:41 AM
Its been a bit since the last time I updated Spring.Web. I wanted to keep up with the bleeding edge so I grabed the latest from CVS and had a couple issues. These issues relate to bidirectional data binding.

- Is the OneWay binding gone?
- I got the following exception after I updated Spring.Web. Any Ideas?


Line 1293: //
Line 1294: InitializeComponent();
Line 1295: base.OnInit(e);
Line 1296: }
Line 1297:


[InvalidCastException: Specified cast is not valid.]
Spring.Web.DataModel.DataModelManager.get_DataMode l()
Spring.Web.DataModel.DataModelManager.InitializeDa taModel()
Spring.Web.DataModel.DataModelManager..ctor(IFeatu resAware target)
Spring.Web.UI.Page.OnInit(EventArgs e)
MyApp.MyPage.OnInit(EventArgs e) in c:\sandbox\MyApp\build\src\MyApp\MyApp.Web.UI.\MyP age.aspx.cs:1295
System.Web.UI.Control.InitRecursive(Control namingContainer) +241
System.Web.UI.Page.ProcessRequestMain() +174

Aleks Seovic
05-16-2005, 11:15 AM
Hi,

OneWay binding is not gone, it's just called differently. Instead of OneWay = true you should now use BindingDirection = BindingDirection.DataModelToControl, which uses BindingDirection enumeration.

Cast exception you are getting looks very strange and shouldn't happen.

- Aleks