高手帮忙在asp.net下GridView右键弹出快捷菜单怎么解决? 选中gridview某行数据,右键显示快捷菜单怎么解决,高分在线等。。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考我昨天解决的帖子http://topic.csdn.net/u/20090812/10/645d9b54-865e-411d-bbe6-bf4e66efcf91.html, 在mouseup事件里面添加你要生成的菜单即可 你要是觉得麻烦,就用jquery好了! 能详细说下吗?不是弹出alert(),是快捷菜单? 你可以用个div去模拟快捷菜单,在div里面画上你的菜单项,然后在mouseup事件里面设定div为显示并定位即可 先要将默认的右键菜单那些东西屏蔽掉,然后用DIV做一个快捷菜单,其他的就是鼠标动作了.... 前台改成如下,后台跟原来一样<html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title> <script type="text/javascript"> function mouseup() { if(event.button==2) { var menu = document.getElementById("div_menu"); menu.style.position = "absolute"; menu.style.left = event.clientX; menu.style.top = event.clientY; menu.style.display = "block"; } } function contextmenu() { window.event.returnValue = false; } </script></head><body> <form id="form1" runat="server"> <div> <asp:GridView runat="server" ID="gv1" OnRowDataBound="gv1_RowDataBound"> </asp:GridView> </div> <div id="div_menu" style="display:none; background-color:#eee"> <table cellpadding="0" cellspacing="0"> <tr> <td>选择...</td> </tr> <tr> <td>退出...</td> </tr> </table> </div> </form></body></html> 无法将类型为“System.String”的对象强制转换为类型“System.Byte[]”。 fileupload如何在页面刷新后还保留其中的路径? 关于手机WEB开发问题 关于html导出到excel中的问题 Ajax的ModalPopupExtender控件使用问题!!~~ Calendar控件~~急救 马上要做一个几百人同时访问的项目,大家有什么好的见意,UP者有分! 关于Datagrid分页的问题 datagrid中如何实现选中某一行后,datagrid的颜色发生变化??? 关于控件的选择问题! ajax 不能调用后台方法 报表转pdf问题
<head id="Head1" runat="server">
<title>Untitled Page</title>
<script type="text/javascript">
function mouseup()
{
if(event.button==2)
{
var menu = document.getElementById("div_menu");
menu.style.position = "absolute";
menu.style.left = event.clientX;
menu.style.top = event.clientY;
menu.style.display = "block";
}
}
function contextmenu()
{
window.event.returnValue = false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView runat="server" ID="gv1" OnRowDataBound="gv1_RowDataBound">
</asp:GridView>
</div>
<div id="div_menu" style="display:none; background-color:#eee">
<table cellpadding="0" cellspacing="0">
<tr>
<td>选择...</td>
</tr>
<tr>
<td>退出...</td>
</tr>
</table>
</div>
</form>
</body>
</html>