Oct 04, 2013, 8:10 PM
[CLOSED] button handle assign code behind does not work
I tripped with a little problem when trying to assign a javascript code to the click handle of a button. Basically on the DirectEvent of a Button I set the handle property of a second Button to "alert('ok2');".
I now try to click the second button after pressed the first one and nothing happens. I guess I should get the alert message.
I understand this is a regular procedure to assign javascript code to the click event so I wonder what I am doing wrong or if it is finally due to a bug in the Ext.Net library.
By the way, I have tried the some example with different types of navigators getting the some all the times.
Thanks for your help.
Here goes the test code:
default.aspx:
I now try to click the second button after pressed the first one and nothing happens. I guess I should get the alert message.
I understand this is a regular procedure to assign javascript code to the click event so I wonder what I am doing wrong or if it is finally due to a bug in the Ext.Net library.
By the way, I have tried the some example with different types of navigators getting the some all the times.
Thanks for your help.
Here goes the test code:
default.aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="extnet_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<extnet:ResourceManager runat="server" />
<extnet:Hidden runat="server" ID="hidden1"></extnet:Hidden>
<extnet:Button runat="server" ID="Button1" Text="Cambiar click">
<DirectEvents>
<Click OnEvent="Changeclick">
</Click>
</DirectEvents>
</extnet:Button>
<extnet:Button runat="server" ID="btn1" Text="Probar Click">
</extnet:Button>
<extnet:TextField runat="server" ID="textbox1"></extnet:TextField>
</form>
</body>
</html>
default.aspx.vb:Imports Ext.Net
Partial Class extnet_Default
Inherits BasicPage
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
textbox1.Text = hidden1.Text
End Sub
Public Sub Changeclick()
btn1.Listeners.Click.Handler = "alert('ok2');"
'btn1.Listeners.Click.Fn = "function(){alert('ok2');}"
'btn1.On("click", New JFunction("alert('ok2');", "button", "e"))
'btn1.OnClientClick = "alert('ok2');"
hidden1.Text = "ok1"
End Sub
End Class
Last edited by Daniil; Oct 11, 2013 at 4:36 AM.
Reason: [CLOSED]