View Full Version : [CLOSED] error accessing Model object from a modal window

Jul 20, 2012, 8:20 PM
Hi we are currently migrating from v1 to v2 and in V1 the following works but does not work in v2. The Model object of the page can no longer be accessed using the following format Text='<%# Model.Name%>'. Does this work differently for V2

public class UserModel
public string Name { get; set; }

public ActionResult Showusers()
UserModel model = new UserModel(){Name = "Henry"};
Ext.Net.MVC.PartialViewResult partialViewResult = new Ext.Net.MVC.PartialViewResult();
partialViewResult.RenderMode = RenderMode.RenderTo;
partialViewResult.SingleControl = true;
partialViewResult.ViewData.Model = model;
partialViewResult.ViewName = "UserPageWindow";
return partialViewResult;

UserPageWindow ascx file

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl< UserModel>" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<ext:Window ID="winAddServer" runat="server" Title='User description' Icon="Wrench" Modal="true"
Height="205" Width="300" Layout="fit" Hidden="false" Resizable="false" IDMode="Static"
AutoDataBind="true" Closable="true">
<ext:Panel runat="server" BodyPadding="10" Header="false" Layout="Form" LabelAlign="Top">
<ext:TextField runat="server" FieldLabel="User :" Text='<%# Model.Name%>'
EnableKeyEvents="true" TabIndex="10" AnchorHorizontal="100%" IDMode="Static" >


Jul 20, 2012, 10:01 PM

I got your code working as expected - I see "Henry" in the TextField.

I can't see any changes in v2 which could potentially stop it working.

Any more details how we can reproduce the issue?

Probably, a test project would be a best option. Please email to:
daniil at ext dot net