我在弹出窗口中有 2 个按钮。单击每个按钮时,弹出窗口执行回调。我的问题是当弹出窗口进行回调时我想知道单击了哪个按钮并导致回调我写了这段代码但它不起作用,因为在 BeginCallback 属性中 S.name 是弹出窗口的名称也 e.buttonID 为 null 因为 Html.DevExpress ().Button 不呈现按钮类型的输入,它呈现 td 和 div 标签请帮助我。
@Html.DevExpress().PopupControl(
settings =>
{
settings.Name = "GetDatepopUp";
settings.PopupElementID = "GetDate";
settings.PopupAction = PopupAction.LeftMouseClick;
settings.CloseAction = CloseAction.CloseButton;
settings.Modal = true;
settings.ShowOnPageLoad = false;
settings.LoadContentViaCallback = LoadContentViaCallback.OnPageLoad;
settings.SetContent(() =>
{
@Html.RenderPartial("CalenderContainerPartialView", "Message");
});
settings.CallbackRouteValues =
new { Controller = "Message", Action = "Calender" };
settings.ClientSideEvents.BeginCallback =
"function(s,e) { e.customArgs['btnName'] = s.name; }";
settings.SetFooterTemplateContent(c =>
{
ViewContext.Writer.Write("<Table style='width:100%'><tr><td>");
Html.DevExpress().Button(buttonsettings =>
{
buttonsettings.Name = "btnNext";
buttonsettings.Text = "<<";
buttonsettings.ClientSideEvents.Click =
"function(s, e) { GetDatepopUp.PerformCallback(); }";
}).Render();
ViewContext.Writer.Write("</td><td>");
Html.DevExpress().Button(buttonsettings =>
{
buttonsettings.Name = "btnPrevious";
buttonsettings.Text = ">>";
buttonsettings.ClientSideEvents.Click =
"function(s, e) { GetDatepopUp.PerformCallback(); }";
}).Render();
ViewContext.Writer.Write("</td></tr></table>");
});
}).GetHtml()