[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Model Binding with Visual Studio 11 Beta

Posted on 2012-03-17
4
Medium Priority
?
520 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

650 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