Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
My code is

C#
function LogoutClick(hasLock, record) {
           alert('Hi');
           if (hasLock===true)
           {
               if (confirm('Do you really want to Log Off ' + record.FirstName + " " + record.LastName + '? This User has Locks.')) {
                   //call logout method
                   var LogoutId = IRX.LogOff(record.data.currentSelectedRows, record.data.SessionID, record.data.Userid, record.data.LoginId);
               }
           else  return false;

           }
           else
           {
               if (confirm('Do you really want to Log Off ' + record.FirstName + " " + record.LastName + '?')) {
                   //logout
               }
               else return false;
           }
       }

       function colLogOffRenderer(value, metadata, record) {

           if ('<%=Session["LoginUserID"].ToString()%>' != record.data.Userid) {
               var Data = IRX.BindButtonToGrid(record.data.SessionID);

               if (Data.length > 0) {
                   return "<input type='button' value = 'Log Off' onclick='LogoutClick(true," + record + ")'/>";
                  
               }
               else {
                   return "<input type='button' value = 'Log Off' onclick='LogoutClick(false," + record + ")'/>";
                  
               }
           }
           else return '';
       }

   </script>



i want to call method name as LogoutClick but it is not call when click on button
please help me
Posted
Updated 29-Sep-14 23:45pm
v2
Comments
Thanks7872 30-Sep-14 5:55am    
And i don't see any code where you are trying to call this method.

Further, "it is not call when click on button" is not at all informative. What do you mean by this? Any errors?

1 solution

HTML
<body>
    <script>
        window.onload = function() {
            var cmd = document.getElementById("buttonID");
            cmd.onclick = function() {
                alert("RUN");
                //LogoutClick(arg1,arg2);

            }
        }
    </script>
    <div>Button</div>
    <input type="button" id="buttonID" value="Send" />
</body>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900