[CLOSED] Can't bind / view ViewData data in Ext.Net controls

  1. #1

    [CLOSED] Can't bind / view ViewData data in Ext.Net controls

    Hi,

    I am setting a string in my ASP.NET MVC controller.. When I output that ViewData (ViewBag now in MVC3) it displays OK:

    <div><%: ViewBag.Company %></div>
    However, I need to use that inside an EXT.NET control. My view has a couple of nested master pages. In the top-most master page, I have tried to output the ViewData inside an ext.net control like this:

        <ext:Menu ID="TreeContextMenu" runat="server" AutoRender="true">
        <Items>
            <ext:MenuItem Text='<%# ViewBag.Company %>' Icon="BuildingAdd">
    But that doesn't work (empty string). As a sanity check, I tried outputting the ViewData string somewhere else in the master page that wasn't inside an ext.net control and it output OK.

    So.. I tried looking at the next level down in my master page. I added similar code to an EXT.NET menu on this master page, and in this page it works OK:

                                    <Menu>
                                        <ext:Menu ID="Menu2" runat="server">
                                            <Items>
                                                <ext:MenuItem Text='<%# ViewBag.Company %>' Icon="Magnifier" Disabled='<%# (bool) ViewData["DisableNormal"] %>' Href="/" />
    It looks like Ext.Net has a problem with nested master pages... Please can you advise?

    Thanks
    Last edited by Daniil; Jan 14, 2011 at 11:17 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Try to set AutoDataBind="true" for MenuItem
  3. #3
    You've nailed it :)

Similar Threads

  1. Replies: 0
    Last Post: Jun 19, 2012, 7:59 AM
  2. Replies: 0
    Last Post: Apr 22, 2012, 9:39 AM
  3. Replies: 1
    Last Post: Dec 11, 2011, 6:45 AM
  4. [CLOSED] put a data view inside a data view,
    By farisqadadeh in forum 1.x Legacy Premium Help
    Replies: 12
    Last Post: Mar 14, 2011, 7:58 PM
  5. Replies: 0
    Last Post: Jun 19, 2009, 4:18 AM

Posting Permissions