Mar 21, 2017, 10:47 AM
Confirm message Handler in CodeBehind
I need to open a dialog when I click a button so I here is what I have done:
Markup:
Markup:
<ext:Button runat="server" ID="Button1" Text="Save New Information" OnDirectClick="Button1_DirectClick"/>
CodeBehind:namespace Admin.Modules
{
public partial class UsersGrid : System.Web.UI.UserControl
{
protected void Button1_DirectClick(object sender, DirectEventArgs e)
{
X.Msg.Confirm("Confirm", "Do you want to update this information also?", new MessageBoxButtonsConfig
{
Yes = new MessageBoxButtonConfig
{
Handler = "App.Direct.DoYes()",
Text = "Yes"
},
No = new MessageBoxButtonConfig
{
Handler = "WndwEdit.close()",
Text = "No"
}
}).Show();
}
[DirectMethod]
public void DoYes()
{
X.MessageBox.Info("Error NOT", "Something went lalala", AnchorPoint.LeftTop, UI.Danger).Show();
}
}
}
The message box is displayed correctly but it doesnt call the DoYes function with error:
Uncaught TypeError: Cannot read property 'DoYes' of undefined