Click here to Skip to main content
15,896,915 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am opening jpg image or pdf in new tab on clicking the hyperlink with navigate url,
how to stop right click in navigateurl page for not to allowing to save and print the opened jpg file or pdf in that page
thnx in advance
e.g.

XML
<asp:TemplateField HeaderText="" ItemStyle-Width="3px">
                            <ItemTemplate>
                                <%--<asp:Label ID="lblDocumentName" runat="server" Text='<%# Bind("DocumentName") %>'></asp:Label>--%>
                                <asp:HyperLink ID="HyperLink1" runat="server" Text='Result' NavigateUrl='<%# Eval("GAtchPath").ToString()%>'
                                    Target="_blank"></asp:HyperLink>
                            </ItemTemplate>
                        </asp:TemplateField>
Posted

1 solution

Use Jquery to avoid right click..
C#
$(document).bind("contextmenu", function(e) {
        return false;
    });
 
Share this answer
 
v2
Comments
durgeshtupkar10 12-May-14 3:04am    
i click hyperlink on page page1.aspx which navigates me in new tab with image with the path of its folder.
where should i put this jquery(i.e. in which page?)
BELGIUMsky 12-May-14 3:17am    
be carefull the user can still disable javascript to run.
like the firefox browser gives the user the ability to disable all scripts on a website
durgeshtupkar10 12-May-14 3:39am    
how to protect files from being saved or print in navigateurl i.e. in new tab of the browser?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900