1

Is it possible to disable right click on webpage but enable right click on Hyperlink(means on any files) in same page.

I know that I can disable right click but on hyperlink if possible please share the code, purpose of disable R/C is to disable Refresh.

Thanks

Priya
  • 1,359
  • 6
  • 21
  • 41
Imran Azam
  • 89
  • 9
  • You may be better placed getting your app/site to work correctly and support browser refreshing. Trust me, you wont block a user refreshing the page in all browsers, devices, mediums...Let the web behave as it was intended and support page reloads. – LDJ Mar 30 '16 at 05:54

1 Answers1

0

Use OnClientClick to return false as below-

<asp:button ID="btninsert" runat="server" text="Button" OnClientClick="return false;" />

For more detail refer: How to avoid page refresh after button click event in asp.net

Disable page refresh after button click ASP.NET

Community
  • 1
  • 1
Priya
  • 1,359
  • 6
  • 21
  • 41
  • Thanks for reply soon but code not sufficient for me Actually i am binding n number of data into grid view and there is one check in grid view header based on this check box i am getting Submitted by clicking on button that is outside of grid view while pressing F5 or Right click Refresh it is getting duplicated same value so i want to restrict them – Imran Azam Mar 30 '16 at 09:52