I have a mvc3 razor helper that show a component:
@helper Component(string params){
<div class="@params">
<div class="hello">
<a href="#" class="link" title="link">Somelink</a>
</div></div>
}
It is more complex than this example but the fact is that I want to have this helper executed on mouseover (javascript)
is that possible ?
No, that’s not possible. Razor helpers execute on the server side, much before any javascript has run and any mouseover events. If you want to handle such events you will have to do it on the client side. And if you need to access the markup generated by the helper you will need to either send an AJAX request to a controller action that will returned the desired markup or have it embedded somewhere on the page (could be hidden initially) and then access it with javascript in the mouseover event callback.