Click here to Skip to main content
14,641,269 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi!

I'm stuck with some problems regarding HTML onclick event handler.
I really need to get this function to be executed in a WebBrowser control inside my Windows form.
<a href="#" onclick="sendstickyto(); document.sendmail.submit(); return false;" class="action-button">SendMessage</a>

Im executing this function in Chrome Console and it works perfectly, but i need to do the same in my windows form.
I guess there is a way to execute the "onclick" event ? :)

Thanks for any help !
Posted
Updated 9-Nov-11 2:36am
v4
Rate this:
Please Sign up or sign in to vote.

Solution 2

The onclick function you're trying to executre is a javascript function. If you were to use Wireshark to analyze what the page does when the user clicks abutton, you will be able to figure out the correct querystring to pass to make the right things happen. BTW, wireshark is a free tool, and google is your friend.
   
Comments
Haugli92 8-Nov-11 8:55am
   
Thanks.. i know what wireshark is :)
but is there any way that i can use:

wb1.Document.InvokeScript("sendstickyto(); document.sendmail.submit(); return false;");

Or do i need to get that querystring you are talking about first ? :)
Rate this:
Please Sign up or sign in to vote.

Solution 1

Hi
Check out below link.......

Control.Click Event
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

try this : an alert function

<pre lang="HTML">
<a href="javascript:alert('here');" >an alert function</a>

</pre>
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100