Executing Java Script Function and Code Behind event togeather
-
hi all i have used Treeview IE Web Control in my project.i want to call a java script function and code behind function on its check event. I have written one java script and added to the treeview on the load event of the form by using the attributes e.g Dim clickHandler1 As String = "TVChkclick();" Me.TreeView1.Attributes.Add("oncheck", clickHandler1) once this function is executed i want to execute the code written in treview1_check event of the treeview which is written in the code behind... the problem right now is only java script code is getting executed the code behind event is not getting executed..if anybody knows the solution let me know... thanks :-D
-
hi all i have used Treeview IE Web Control in my project.i want to call a java script function and code behind function on its check event. I have written one java script and added to the treeview on the load event of the form by using the attributes e.g Dim clickHandler1 As String = "TVChkclick();" Me.TreeView1.Attributes.Add("oncheck", clickHandler1) once this function is executed i want to execute the code written in treview1_check event of the treeview which is written in the code behind... the problem right now is only java script code is getting executed the code behind event is not getting executed..if anybody knows the solution let me know... thanks :-D
hi i have a button in my page and add this attribute to button <javascript:return confirm('Message');")>> and also i have a textbox in my page that a requirefiledvalidator check that not be empty. if i click button confirm occur for me and if i press <> the code of this event execute while textbox is empty and validator not check the textbox. when event onclick of button finished validator check the textbox. please help me thanks a lot
-
hi all i have used Treeview IE Web Control in my project.i want to call a java script function and code behind function on its check event. I have written one java script and added to the treeview on the load event of the form by using the attributes e.g Dim clickHandler1 As String = "TVChkclick();" Me.TreeView1.Attributes.Add("oncheck", clickHandler1) once this function is executed i want to execute the code written in treview1_check event of the treeview which is written in the code behind... the problem right now is only java script code is getting executed the code behind event is not getting executed..if anybody knows the solution let me know... thanks :-D
Hi there, You need to reinsert the script to cause the page to post back since it is overwritten at the client side by your sample script:
Me.TreeView1.Attributes.Add("oncheck", clickHandler1 & " if (this.clickedNodeIndex != null)
this.queueEvent('oncheck', this.clickedNodeIndex)")Also, you need to make sure that the
AutoPostBack
property is set totrue
.