Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Executing Java Script Function and Code Behind event togeather

Executing Java Script Function and Code Behind event togeather

Scheduled Pinned Locked Moved ASP.NET
javatoolshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    payal sheth
    wrote on last edited by
    #1

    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

    A M 2 Replies Last reply
    0
    • P payal sheth

      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

      A Offline
      A Offline
      ali bagheri
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • P payal sheth

        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

        M Offline
        M Offline
        minhpc_bk
        wrote on last edited by
        #3

        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 to true.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups