Oct 13, 2015, 8:27 AM
MessageBox
Controler Files :
namespace Aytek.WebLis.Controllers
{
[DirectController(AreaName = "MessageBox_Basic")]
public class LaboratuvarModuluController : Controller
{
public ActionResult Index()
{
return View();
}
[DirectMethod(Namespace = "CompanyX")]
public ActionResult DoConfirm()
{
X.Msg.Confirm("Message", "Confirm?", new MessageBoxButtonsConfig
{
Yes = new MessageBoxButtonConfig
{
Handler = "CompanyX.MessageBox_Basic.DoYes()",
Text = "Yes Please"
},
No = new MessageBoxButtonConfig
{
Handler = "CompanyX.MessageBox_Basic.DoNo()",
Text = "No Thanks"
}
}).Show();
return this.Direct();
}
[DirectMethod(Namespace = "CompanyX")]
public ActionResult DoYes()
{
this.GetCmp<Label>("Label1").Text = "YES";
return this.Direct();
}
[DirectMethod(Namespace = "CompanyX")]
public ActionResult DoNo()
{
this.GetCmp<Label>("Label1").Text = "NO";
return this.Direct();
}
}
}
Chtml Files :@{
ViewBag.Title = "Confirm MessageBox with ButtonsConfig - Ext.NET MVC Examples";
Layout = null;
var X = Html.X();
}
@Html.X().ResourceManager(ViewBag.ManagerConfig as MvcResourceManagerConfig)
<p>
@(X.Button()
.Text("Confirm")
.Width(100)
.Height(30)
.Icon(Icon.Error)
.OnClientClick("CompanyX.MessageBox_Basic.DoConfirm()")
)
</p>
<p>
@(X.Label()
.ID("Label1")
.Format("You clicked the '<b>{0}</b>' Button.")
)
</p>
When Click Button It never does anything why What is problem ?
Last edited by Daniil; Oct 13, 2015 at 1:44 PM.
Reason: Please use [CODE] tags