locked
possible CTEs in the Code Gallery Scaffold sample code RRS feed

  • Question

  • User-1614457691 posted

     FYI, it looks there are some possible CTEs in the Code Gallery Scaffold sample code.

    This is the page where I got to code...

    http://code.msdn.microsoft.com/dynamicdata/Wiki/View.aspx?title=NET35Samples

    These are the compile-time-errors when I tried to compile with VS.NET 2008 SP1...

    Error 1 Type 'System.Web.DynamicData.DynamicDataManager' does not have a public property named 'enablequerystringselection'. C:\Code\Temp\DynamicDataSamples\ScaffoldDemo\DynamicData\PageTemplates\List.aspx 6 

    Error 2 Type 'System.Web.DynamicData.DynamicDataManager' does not have a public property named 'enablequerystringselection'. C:\Code\Temp\DynamicDataSamples\ScaffoldDemo\DynamicData\PageTemplates\ListDetails.aspx 6 

    ...so, I just thought you should know.

    Thank you.

    -- Mark Kamoski

    Thursday, August 28, 2008 1:38 PM

Answers

All replies

  • User-1614457691 posted

    FYI, this is a follow-up to my post above.

    To fix the CTEs noted above, I removed the attribute from the tag in the code-infront.

    (I am not sure of the repercussions of that action; but, it got past the compiler at least.)

    After that, I got another CTE, as follows...

    //Error 1 The call is ambiguous between the following methods or properties:

    //'System.Web.DynamicData.MetaTable.GetActionPath(string, System.Web.Routing.RouteValueDictionary)'

    //and

    //'System.Web.DynamicData.MetaTable.GetActionPath(string, System.Collections.Generic.IList<object>)'

    //C:\Code\Temp\DynamicDataSamples\ScaffoldDemo\DynamicData\PageTemplates\List.aspx.cs 37 33 C:\...\ScaffoldDemo\

     

    ...so to fix that I changed the code-behind as noted below... 

     

     

    //old
    //<asp:dynamicdatamanager id="DynamicDataManager1" runat="server" enablequerystringselection="true" autoloadforeignkeys="true" />

    //new
    //<asp:dynamicdatamanager id="DynamicDataManager1" runat="server" autoloadforeignkeys="true" />

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Xml.Linq;
    using System.Web.DynamicData;

    public partial class List : System.Web.UI.Page
    {
     protected MetaTable table;

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

     protected void Page_Load(object sender, EventArgs e)
     {
      table = GridDataSource.GetTable();
      Title = table.DisplayName;

      //old
      //InsertHyperLink.NavigateUrl = table.GetActionPath(PageAction.Insert, null);

      //Error 1 The call is ambiguous between the following methods or properties:
      //'System.Web.DynamicData.MetaTable.GetActionPath(string, System.Web.Routing.RouteValueDictionary)'
      //and
      //'System.Web.DynamicData.MetaTable.GetActionPath(string, System.Collections.Generic.IList<object>)' 
      //C:\Code\Temp\DynamicDataSamples\ScaffoldDemo\DynamicData\PageTemplates\List.aspx.cs 37 33 C:\...\ScaffoldDemo\

      //new
      System.Web.Routing.RouteValueDictionary myDictionary = null;
      InsertHyperLink.NavigateUrl = table.GetActionPath(PageAction.Insert, myDictionary);

      // Disable various options if the table is readonly
      if (table.IsReadOnly)
      {
       GridView1.Columns.RemoveAt(0);
       InsertHyperLink.Visible = false;
      }
     }

     protected void OnFilterSelectedIndexChanged(object sender, EventArgs e)
     {
      GridView1.PageIndex = 0;
     }
    }

     

    Thursday, August 28, 2008 1:55 PM
  • User660823006 posted

    Those samples were for older releases of Dynamic Data. I've pulled them all down now and changed the page to point to the final versions that are on Codeplex: http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 28, 2008 3:47 PM
  • User-1230855586 posted

    Hi All,

    I have installed MS ASP.NET 3.5 Extension CTP. Then I followed steps from http://msdn.microsoft.com/en-us/library/cc668188.aspx. Per steps, after creating asp.net web site I added all the required code. At the end i compile solution and I am getting following error.

    Error    1    Type 'System.Web.DynamicData.DynamicDataManager' does not have a public property named 'ID'. 

    Then I download the samples from http://www.codeplex.com/ for dynamic data web site, which are running fine. Only difference is samples from http://www.codeplex.com referring "System.Web.Extensions, Version=3.5.0.0" and my asp.net web site is having "System.Web.Extensions, Version=3.6.0.0". I could not figure out why 3.6 is coming to my site. If I change all to 3.5 then getting errors about controls not found. Means 3.6 is required.

    Can anybody help to resolve this error.

    Thanks,

    Sandi 

       
     

    Wednesday, November 12, 2008 4:07 AM
  • User660823006 posted

    Dynamic Data was released this summer as part of ASP.NET 3.5 SP1. You should unsintall the Extension CTP which is very old and instead install the service pack: http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en.

    Wednesday, November 12, 2008 12:31 PM
  • User-1230855586 posted

     Hi Scott,

    I already have ASP.NET SP1 installed. Still get this error.

    Thanks,

    San 

    Friday, November 21, 2008 3:44 AM
  • User660823006 posted

    If you have 3.5 SP1 installed older projects that were created with the 3.6 version will no longer work because they are refering to preview builds before RTM. If you create a new application with 3.5 SP1 installed they should be find. You can probably get an older project to run by fixing the references to 3.6 back to 3.5 and copying the DynamicData directory from a 3.5 SP1 project over the Dynamic Data directory in the older application.

    Friday, November 21, 2008 8:38 AM