Feb 17, 2011, 9:11 PM
[CLOSED] EXT.NET and ASP.NET MVC View Model
Hi Guys,
I am trying to access the properties of my View Model but can't seem to get this to work with the EXT controls. please offer some assistance. The value from the model is not being displayed in the textbox.
Below i am trying to access Model.Username from my LogOnModel view model.
I am trying to access the properties of my View Model but can't seem to get this to work with the EXT controls. please offer some assistance. The value from the model is not being displayed in the textbox.
Below i am trying to access Model.Username from my LogOnModel view model.
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Ext.Net.MVC.Demo.Controllers.LogOnModel>"%>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<ext:Window
ID="LoginWindow"
runat="server"
Closable="false"
Resizable="false"
Height="19"
Icon="Lock"
Title="Login"
Draggable="true"
Width="300"
Modal="true"
Layout="fit"
BodyBorder="false"
LabelAlign="Top"
Padding="5">
<Items>
<ext:FormPanel ID="FormPanel1"
runat="server"
FormID="form1"
Border="false"
Layout="form"
BodyBorder="false"
BodyStyle="background:transparent;"
LabelAlign ="Top"
>
<Items>
<ext:TextField
ID="UserName"
runat="server"
FieldLabel="<%$ Resources:WebResources|Account.FormControls, LabelUsername %>"
AllowBlank="false"
AnchorHorizontal="80%"
MsgTarget="Under"
Text = "<%= Model.Username %>"
/>
<ext:TextField
ID="Password"
runat="server"
InputType="Password"
FieldLabel="<%$ Resources:WebResources|Account.FormControls, LabelPassword %>"
AllowBlank="false"
AnchorHorizontal="80%"
MsgTarget="Under"
/>
<ext:HyperLink
ID="ForgotPassword"
runat="server"
Text="Forgot your password"
AnchorHorizontal="80%"
HideLabel ="true"
/>
</Items>
</ext:FormPanel>
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Login" Icon="Accept">
<DirectEvents>
<Click
Url="/Account/Login/"
Timeout="60000"
FormID="form1"
CleanRequest="true"
Method="POST"
>
<EventMask MinDelay="250" />
<ExtraParams>
<ext:Parameter Name="ReturnUrl" Value="Ext.urlDecode(String(document.location).split('?')[1]).r || '/'" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:Window>
public ActionResult Login()
{
LogOnModel model = new LogOnModel { UserName = "demo", Password = "demo" };
return this.View(model);
}
Last edited by geoffrey.mcgill; Feb 18, 2011 at 6:24 PM.
Reason: [CLOSED]