why Model equals to null?

why Model equals to null?

Old forum URL: forums.lhotka.net/forums/t/9138.aspx


zhangxijun posted on Monday, June 28, 2010

I use csla for silverlight to build my project, but when the home page loaded, the content display blank, Why the Model equals null ? So I have to load it again?

even I set receiveTimeout and others to "10:10:00" in ServiceRefrence.Clientconfig file.

public class HomeViewModel : ViewModel<HomeModel>

{

    public HomeViewModel() {  BeginRefresh("BeginGetHomeModel"); }

    protected override void OnRefresh()

    {

        if(Model == null){ BeginRefresh("BeginGetHomeModel"); }  //Retrive Model Again!

    }

}

RockfordLhotka replied on Monday, June 28, 2010

You should check the Error property to see if there's some exception occurring during that first load.

zhangxijun replied on Wednesday, June 30, 2010

Thanks, the error message follows:

DataPortal.Fetch failed(could not load file or assembly 'system.ComponentModel.DataAnnatations' or one of its dependencies.

It seems that I should install the .net framework 3.5 sp1.

Copyright (c) Marimer LLC