Jan 14, 2011, 11:48 AM
[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:
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:
Thanks
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]