Dec 10, 2010, 3:50 PM
[CLOSED]Calling Private method as Message box handler
Hi i am really impressed with the effort you guys have put into Ext.net .thumbs up ;)
ok quickly getting into the example.
Design of webpage.[ASP.NET]
1. But why can't i do the same when i set them to Private :confused:
2. Is it possible to declare the handers as function rather than "string" if yes any samples?
ok quickly getting into the example.
Design of webpage.[ASP.NET]
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Sample Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="Samples">
</ext:ResourceManager>
<ext:Label ID="Label1" runat="server">
</ext:Label>
<ext:Button ID="Button1" runat="server" Text="Submit" Icon="ApplicationXpTerminal">
<Listeners>
<Click Handler="Samples.ShowMessage()" />
</Listeners>
</ext:Button>
</div>
</form>
</body>
</html>
Code Behind: default.aspx.cs [DirectMethod]
public void ShowMessage()
{
X.Msg.Confirm("Title", "This is some body", new MessageBoxButtonsConfig
{
Yes = new MessageBoxButtonConfig { Handler = "Samples.ClickedYES()", Text = "YES" },
No = new MessageBoxButtonConfig { Handler = "Samples.ClickedNO()", Text = "NO" }
}).Show();
}
[DirectMethod]
public void ClickedYES()
{
Label1.Text = "You clicked YES";
}
[DirectMethod]
public void ClickedNO()
{
Label1.Text = "You clicked NO";
}
as you see the ClickedYes() ,ClickedNo(), ShowMessage()
are decorated with public Keyword. The code above works perfectly fine :D. 1. But why can't i do the same when i set them to Private :confused:
2. Is it possible to declare the handers as function rather than "string" if yes any samples?
Last edited by deeptechtons; Dec 12, 2010 at 2:06 AM.
Reason: changed title to solved,typo in title