user979432
user979432

Reputation: 11

Listing (in C#) all JS functions binded to client side events of a web page

what I want to do, is to write a program to check if clicking on a links, or buttons in a web page fires a client side code (JS). Also I want, to list all JS functions binded to client side event (onclick for example).

Please help me, thats interesting problem, Tom.

P.S. I am using C# and .NET 4.0.

Upvotes: 0

Views: 102

Answers (1)

competent_tech
competent_tech

Reputation: 44941

I think that the only shot that you have at doing this successfully is to intercept the page as it is being rendered and use something like the HTML Agility Pack to parse the rendered HTML looking for events.

And even that won't cover nearly all of the bases.

We have a tremendous amount of code where javascript function names are generated and assigned to controls dynamically, both on the server side and on the client side, depending on what our needs are.

Trying to infer all of this by just examining code is going to be next to impossible.

Upvotes: 1

Related Questions