How to link ASP sub in clickevent of td element

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nayan Desai

    How to link ASP sub in clickevent of td element

    <script runat"Server">
    public sub LogOut1()
    Session.abandon ()
    end sub
    </script>


    In td element

    <td onclick="LogOut 1()>
    <a Log Out>
    </a>
    </td>

    it is giving error when i click the td element in browser.
  • jhardman
    Recognized Expert Specialist
    • Jan 2007
    • 3405

    #2
    OK, first lesson in ASP:

    The ASP script RUNS ON THE SERVER. It is not sent to the browser. THERE IS NO WAY TO LINK A CLICK EVENT TO AN ASP FUNCTION. It cannot be done. This would be like ordering food from a restaurant, taking it home, putting a bite in your mouth, and then saying, "Waiter, please have the chef remove the peas." You are not at the restaurant anymore, it is too late to have the chef change the order. Stop trying to do it, the only one who can get that to work is Chuck Norris.

    If you explain what you are trying to do, maybe we could suggest an alternative approach.

    Jared

    Comment

    Working...