Thursday, September 6, 2007, 11:40
Posted by Administrator
When you want to use a onmouseover event that triggers through javascript a method from serverside c# code, you need a button ...Posted by Administrator
HTML ATTRIBUTE
onmouseover="GetItems()"JAVASCRIPT
function GetItems(){
document.getElementById('btn_getitems').click();
}ASP.NET BUTTON
<asp:Button id="btn_getitems" runat="server" OnClick="btn_getitems_Click" UseSubmitBehavior="false" style="visibilty: hidden;"/>It is very important to use the UseSubmitBehavior="false" attribute because otherwise your serverside method won't be called.
C#
public void btn_getitems_Click(object sender, EventArgs args) {
DisplayAllItems();
}Now you see that when you use the onmouseover in Firefox works as great as in IE...
;)




( 3 / 601 )

Tom Van Gaever - Blog

Avatar






