Jun 21, 2010, 4:38 PM
[CLOSED] Javascript and MVC application
Hello,
in an MVC application I have the following View (Test.aspx):
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<%@ 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 id="Head1" runat="server">
<title>Test</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Window ID="Window1"
runat="server"
Title="Resize Me"
Icon="ArrowOut"
Width="500"
Height="300"
MinWidth="300"
MinHeight="200"
Plain="true"
Padding="5"
ButtonAlign="Center"
LabelWidth="55"
Layout="Form">
<Items>
<ext:TextField ID="TextField1" runat="server" FieldLabel="Send to" AnchorHorizontal="100%" />
<ext:TextField ID="TextField2" runat="server" FieldLabel="Subject" AnchorHorizontal="100%" />
<ext:TextArea ID="TextArea1" runat="server" HideLabel="true" AnchorHorizontal="100%" AnchorVertical="-53" />
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Save" Icon="Disk" />
<ext:Button ID="Button2" runat="server" Text="Cancel" Icon="Decline" />
</Buttons>
</ext:Window>
</form>
</body>
</html>
and the related controller's method: public ActionResult Test()
{
return View();
}
I'd like to invoke the Test() method from client code. I tried with this code:
var myTest = function () {
Ext.Ajax.request({
url: '/General/Test'
});
but when I invoke myTest function, nothing happens, even if the Test method is correctly invoked.
Is this the right method to accomplish this?