private void SetGridRows(GridView gv) { int iRowCount = 0; foreach (GridViewRow gr in gv.Rows) { Label lblName = (Label)gr.FindControl("WorkID"); string id = lblName.Text; string sClass = "ListNorRow"; if (iRowCount == 1) { sClass = "ListAltRow"; } gr.Attributes.Add("onmouseout", "javascript:this.className='" + sClass + "'"); gr.Attributes.Add("onmouseover", "ShowPopup('" + id + "');javasscript:this.className='ListSelRow';"); gr.Attributes.Add("OnClick", "HideContent('SubMenu');"); iRowCount = iRowCount == 0 ? 1 : 0; } }
Quote:Use the oncontextmenu event. Here's an example: HTML <div oncontextmenu="javascript:alert('success!');return false;"> Lorem Ipsum </div> Don't forget to return false, otherwise the standard context menu will still pop up.
<div oncontextmenu="javascript:alert('success!');return false;"> Lorem Ipsum </div>
SetGridRows
GridViewRow
onmouseout
onmouseover
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)