Call







InitCall helper initiates a server call that can be executed using awe.oc(name, opt) js function, similar to awe.open(name, opt) used for opening popups
CallDemo/Index.cshtml
@Html.Awe().InitCall("callHi").Url(Url.Action("SayHi")).Success("echo")
@Html.Awe().InitCall("callName").Url(Url.Action("SayName")).Success("echo").Parent("txtName", "name")

<button type="button" class="awe-btn" onclick="awe.oc('callHi')">Click to call</button>
<br />
<br />
<button type="button" class="awe-btn" onclick="awe.oc('callName', { params: { id: 15 } })">Call with parameters</button>
<br />
<br />
@Html.Awe().TextBox("txtName").Placeholder("write a name here").Value("Art Vandelay")

<script>
function echo(res) {
alert(res);
}
</script>
Demos/Helpers/CallDemoController.cs
using System.Web.Mvc;

namespace AwesomeMvcDemo.Controllers.Demos.Helpers
{
public class CallDemoController : Controller
{
public ActionResult Index()
{
return View();
}

public string SayHi()
{
return "server says hi";
}

public string SayName(string name, int id)
{
return "my name is " + name + "; id = " + id;
}
}
}