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
Solved

Model Binding with Visual Studio 11 Beta

Posted on 2012-03-17
4
516 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
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
edit .asp files 5 30
Name Space error VS2015 1 22
VS 2015 is giving [No relevant source lines] 2 24
Code works but breaks when I add one section 4 20
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

808 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