Feb 21, 2011, 8:31 AM
Still unable to make login button as default button
I tried with the code u given here as same in my asp.net mvc application. But still it is not working and am getting the error like below.
"Property 'KeyMap' does not have a property named 'Target'."
Please find the complete code of Login page which i developed.
Please can anyone solve my problem as early as possible. Because it is urgent.
Thanks in advance..
"Property 'KeyMap' does not have a property named 'Target'."
Please find the complete code of Login page which i developed.
Please can anyone solve my problem as early as possible. Because it is urgent.
Thanks in advance..
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Ext.Net.MVC.Demo.Models.LoginModel>" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>CCUBE - POC application</title>
<style type="text/css">
h1
{
font: normal 60px tahoma, arial, verdana;
color: #E1E1E1;
}
h2
{
font: normal 20px tahoma, arial, verdana;
color: #E1E1E1;
}
h2 a
{
text-decoration: none;
color: #E1E1E1;
}
.x-window-mc
{
background-color: #F4F4F4 !important;
}
</style>
<script type="text/javascript">
if (window.top.frames.length !== 0) {
window.top.location = self.document.location;
}
</script>
</head>
<body>
<ext:ResourceManager runat="server" />
<%= ViewData["Message"] %>
<h1>
CCUBE</h1>
<h2>
</h2>
<ext:Window ID="LoginWindow" runat="server" Closable="false" Resizable="false" Height="130"
Icon="Lock" Title="Login" Draggable="true" Width="300" Modal="true" Layout="fit"
BodyBorder="false" Padding="5">
<Items>
<ext:FormPanel ID="PnlLogin" runat="server" FormID="form1" Border="false" Layout="form"
BodyBorder="false" BodyStyle="background:transparent;">
<%--Url='<%# Html.AttributeEncode(Url.Action("Login")) %>'--%>
<Items>
<ext:TextField ID="txtUsername" runat="server" FieldLabel="Username" AllowBlank="false"
BlankText="Username is required." AnchorHorizontal="100%" />
<ext:TextField ID="txtPassword" runat="server" InputType="Password" FieldLabel="Password"
AllowBlank="false" BlankText="Password is required." AnchorHorizontal="100%" />
</Items>
<Buttons>
<ext:Button ID="btnLogin" runat="server" Text="Login" Icon="Accept">
<DirectEvents>
<Click Url="/Account/Login/" Timeout="60000" FormID="form1" CleanRequest="true" Method="POST"
Before="Ext.Msg.wait('Verifying...', 'Authentication');" Failure="Ext.Msg.show({
title: 'Login Error',
msg: result.errorMessage,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
});">
<EventMask MinDelay="250" ShowMask="false" Target="CustomTarget" CustomTarget="={#{PnlLogin}.getEl()}" />
<ExtraParams>
<ext:Parameter Name="ReturnUrl" Value="Ext.urlDecode(String(document.location).split('?')[1]).r || '/'"
Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:FormPanel>
</Items>
<ext:KeyMap runat="server" Target="={PnlLogin.getBody()}">
<ext:KeyBinding>
<Keys>
<ext:Key Code="ENTER" />
</Keys>
<Listeners>
<Event Handler="e.stopEvent();#{BtnLogin}.fireEvent('click');" />
</Listeners>
</ext:KeyBinding>
</ext:KeyMap>
</ext:Window>
</body>
</html>
Last edited by geoffrey.mcgill; Feb 06, 2015 at 11:46 PM.