[The context type WebApplication1.DataClasses1DataContext does not belong to any registered model.] - 3.5 Preview Dynamic Data

Last post 04-21-2008 2:48 AM by deepfree. 2 replies.

Sort Posts:

  • [The context type WebApplication1.DataClasses1DataContext does not belong to any registered model.] - 3.5 Preview Dynamic Data

    04-17-2008, 11:41 PM
    • Loading...
    • deepfree
    • Joined on 07-07-2002, 3:11 PM
    • Posts 2

    I convert my dynamic-data web application(not, web-site) CTP to Preview version. Recently.

    But, I have error-message, help me please.

    CTP version 

       protected void Page_InitComplete(object sender, EventArgs e)
        {
                DynamicGridView1.InitializeMaster(/*loadForeignKeys*/true);
                DynamicGridView1.RegisterDetails(DynamicDetailsView1, /*loadForeignKeys*/true);
        }

    Preview version

        <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" EnableQueryStringSelection="true" AutoLoadForeignKeys="true" /> (at ASPX)

       protected void Page_InitComplete(object sender, EventArgs e)
        {
                DynamicDataManager1.RegisterControl(GridView1);
                DynamicDataManager1.RegisterControl(DetailsView1);
        }

    Error Message Shown:

    [InvalidOperationException: The context type WebApplication1.DataClasses1DataContext does not belong to any registered model.]
       System.Web.DynamicData.MetaModel.GetModel(Type contextType) +145
       System.Web.DynamicData.DynamicDataExtensions.GetTable(IDynamicDataSource dataSource) +87
       System.Web.DynamicData.DynamicDataManager.RegisterControl(Control control) +79
       WebApplication1._Default.Page_InitComplete(Object sender, EventArgs e) in C:\Users\deepfree\Desktop\WebApplication1\WebApplication1\Default.aspx.cs:20
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +41
       System.Web.UI.Page.OnInitComplete(EventArgs e) +104
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2469

    Let me know how can i fix this problem.

    thanks.

  • Re: [The context type WebApplication1.DataClasses1DataContext does not belong to any registered model.] - 3.5 Preview Dynamic Data

    04-18-2008, 3:02 AM
    Answer
    • Loading...
    • marcind
    • Joined on 09-06-2007, 5:11 AM
    • Redmond, WA
    • Posts 305
    • AspNetTeam

    Have you modified your Global.asax file to register your data context? 

    Marcin Dobosz
    SDE, ASP.NET Team, Microsoft
    Get the Dynamic Data Futures 7/16 update.
  • Re: [The context type WebApplication1.DataClasses1DataContext does not belong to any registered model.] - 3.5 Preview Dynamic Data

    04-21-2008, 2:48 AM
    • Loading...
    • deepfree
    • Joined on 07-07-2002, 3:11 PM
    • Posts 2

    I added global.asax.
    Now, there is no problem.

    Thank you a lot.

Page 1 of 1 (3 items)
Microsoft Communities
Page view counter