Solved

Model Binding with Visual Studio 11 Beta

Posted on 2012-03-17
4
518 Views
Last Modified: 2012-03-23
I have a WinForm application that is created in Visual Studio 11 Developer Preview. It used Model Binding to bind data to a GridView. I upgraded my environment to  Visual Studio 11 Beta and my application  no longer works. Does anyone know of any changes to the way this is done.

This is the error: "'Item' is not declared. It may be inaccessible due to its protection level." I could find "Items" but not "Item"

Thank you


    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        DataKeyNames="organizationId,organizationGuid"
        ModelType="Organization"  
        SelectMethod="BindGrid" MultipleActiveResultSets="True"
        EmptyDataText="There are no data records to display.">
        <Columns>
            <asp:TemplateField HeaderText="organizationGuid" SortExpression="organizationGuid" Visible="False">
                <ItemTemplate>
                    <asp:Label ID="organizationGuidLabel1" runat="server" Text='<%# Item.organizationGuid%>' />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
0
Comment
Question by:ruffone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 37733795
>I have a WinForm application that is created in Visual Studio 11 Developer Preview.
>It used Model Binding to bind data to a GridView.

You have winforms app and you are using GridView? An ASP.NET GridView? I have not checked VS11 yet but have Winforms changed so much?
0
 
LVL 4

Author Comment

by:ruffone
ID: 37734038
Well, they tried it out at least in Visual Studio 11 Developer Preview as you can see in the 2 links below. I am trying to figure out if they kept it in for Visual Studio 11 Beta because my implementation broke when I installed VS11Beta
http://www.sitepoint.com/asp-net-4-5-strongly-typed-data-controls-model-binding/
http://webformsmodelbinder.codeplex.com/
0
 
LVL 4

Accepted Solution

by:
ruffone earned 0 total points
ID: 37735087
The ModelType attribute was renamed to ItemType in the Beta release
0
 
LVL 4

Author Closing Comment

by:ruffone
ID: 37756264
No appropriate responses from a user on this site. My question even taught CodeCruiser a thing or two.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question