Sep 29, 2011, 4:48 AM
Create new JFunction in C# is ok but not in VB
I'm a newbie in VB and ext. Now i have a project with asp.net with VB
I wanna create some example with VB (on ext.net we only have demo with C#) and i have a trouble:
The javascript code is to display a notification as the demo of ext.net. We can see more about this demo on: https://examples1.ext.net/#/MessageBox/Basic/Overview/
However i can't reproduce this demo in VB.
I can call my Javascript code in C# (it's work).
I wanna create some example with VB (on ext.net we only have demo with C#) and i have a trouble:
The javascript code is to display a notification as the demo of ext.net. We can see more about this demo on: https://examples1.ext.net/#/MessageBox/Basic/Overview/
However i can't reproduce this demo in VB.
I can call my Javascript code in C# (it's work).
<script runat="server">
protected void Button2_DirectClick(object sender, Ext.Net.DirectEventArgs e)
{
var a = new JFunction { Fn = "showResult" };
(new MessageBox()).Confirm("Confirm", "Are you sure you want to do that?", new JFunction { Fn = "showResult" }).Show();
}
</script>
The VB code (that doesn't work)<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As Ext.Net.DirectEventArgs) Handles Button1.DirectClick
Dim msb As MessageBox = New MessageBox()
msb.Confirm("Confirm", "Are you sure you want to do that?", New JFunction("showResult")).Show()
End Sub
</script>
The Javascript code for C# and VB are the same:<script type="text/javascript">
var showResult = function (btn) {
Ext.Msg.notify("Button Click", "You clicked the " + btn + " button");
};
var showResultText = function (btn, text) {
Ext.Msg.notify("Button Click", "You clicked the " + btn + 'button and entered the text "' + text + '".');
};
</script>
How can i pass this trouble ?