Jan 21, 2011, 3:14 AM
[CLOSED] [1.0] MVC AjaxResult
This is a continuation of the following post: http://forums.ext.net/showthread.php...Control-Hiding
So this is the code I have and I can see the XHR is returning the Json to the browser:
View:
So this is the code I have and I can see the XHR is returning the Json to the browser:
{script:"tTestText.setValue(\"This is from code!\");"}
So I think I might be missing something. The following is my View and Controller:View:
<ext:TextField ID="tTestText" runat="server" Text="Default stuff" />
<ext:Button ID="bTestButton" runat="server" Text="Test Button" Icon="Accept">
<DirectEvents>
<Click Url="/Home/Tester" CleanRequest="true" Method="POST">
<ExtraParams>
<ext:Parameter Name="Value" Value="#{tTestText}.getValue()" Mode="Raw" />
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
Controller:[HttpPost]
public ActionResult Tester(string value)
{
ActionResult result = null;
if (!string.IsNullOrEmpty(value)) {
Ext.Net.TextField tTestText = X.GetCmp<TextField>("tTestText");
tTestText.Text = "This is from code!";
result = new AjaxResult(tTestText.GetGeneratedScripts());
} else {
result = RedirectToAction("SomeAction", "Home");
}
return result;
}
This is not updating the tTestText field with the code, however it's being passed back from the browser. Am I missing something?
Last edited by geoffrey.mcgill; Jan 23, 2011 at 4:27 AM.
Reason: [CLOSED]