Click here to Skip to main content
14,266,036 members
Rate this:
Please Sign up or sign in to vote.
<script>
   function ShowMenu(control, e) {
      var posx = e.clientX + window.pageXOffset + 'px'; //Left Position of Mouse Pointer
      var posy = e.clientY + window.pageYOffset + 'px'; //Top Position of Mouse Pointer
      document.getElementById(control).style.position = 'absolute';
      document.getElementById(control).style.display = 'inline';
      document.getElementById(control).style.left = posx;
      document.getElementById(control).style.top = posy;
   }
   function HideMenu(control) {
      document.getElementById(control).style.display = 'none';
   }
</script>

i have this code in Header this java script and then in GridView
i have this one
onmousedown="HideMenu('contextMenu')"  onmouseup="HideMenu('contextMenu')" oncontextmenu="ShowMenu('contextMenu',event)"

and then i have in item tmplate
<itemtemplate>
   <div id="ShowMenu">
      <asp:linkbutton id="btnEdit" runat="server"  commandname="Edit" text="Edit" CssClass="pri" />
   </div>
</itemtemplate>

when i try too Run Edit it isn't working any Answears? Sry For my English
Posted
Updated 10-Dec-15 0:16am
v2
Comments
phil.o 10-Dec-15 6:19am
   
"isn't working" is not a valid issue description. Please push the "Improve question" button and describe your issue (symptoms, error messages, etc...).
You can use an online translator if you are not fluent in english.
Moreover, if you are waiting for an answer, you may have to ask an actual question, which you didn't :)
GTR0123 10-Dec-15 6:22am
   
here is not working "CommandName" that the point
User 10668410 11-Dec-15 22:17pm
   
This shouldn't be tagged as C# because you are requesting a Javascript solution.

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