Solved

Model Binding with Visual Studio 11 Beta

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now