• 0

Javascript New Window Help


Question

I have been asked to help with a site because their old developer went out of business. THey built a custom asp.net website that sells house plans and they insist on disabling right click with a body tag using the "oncontextmenu" method. So fine... but they allow larger previewing of the homes using a javascript window opener to show the enlarged image. Problem is the new window allows right click. I have gone through all the code and pinpointed the code below which enables the window opener to preview the pictures:


{
HtmlImage imgSmallImage = (HtmlImage)e.Item.FindControl("imgSmallImage");
imgSmallImage.Attributes.Add("onClick", "javascript:image_open('houses/" + DataBinder.Eval(e.Item.DataItem, "PlanImage") + "')");

}
[/CODE]

My question, is there any way to disable right click by modifiying this opening code so the image in this new window can't be right clicked. I see no other way and javascript isnt my strong point. I wish the client would just not do this but they insist.

Thank you very much

Link to comment
https://www.neowin.net/forum/topic/1058520-javascript-new-window-help/
Share on other sites

2 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Posts

    • Ridiculous claim that the labor cost difference of $6000 annually would increase cost per phone by $200. The employees produce 3 phones per month or what?
    • Sparkle 2.20.1 by Razvan Serea Sparkle is a free, open-source Windows optimization tool designed to make your PC faster, cleaner, and more private. With Sparkle, you can easily debloat Windows by removing unnecessary apps and services, disable Microsoft tracking to enhance privacy, and apply performance tweaks to boost speed. Its cleaner removes junk and temporary files, while every change is safe and fully reversible. Sparkle also features a modern, user-friendly interface with automatic updates, making system maintenance simple. Explore over 39 tweaks, from disabling telemetry and hibernation to optimizing network and game settings, all aimed at customizing and enhancing your Windows experience. Sparkle supports Windows 10 and 11. Sparkle 2.20.1 changelog: You can now change the Animation Direction from Up, Left, or Off. Added configurable animation direction (Up, Left, Off) for improved accessibility Added TTL caching to the system info backend Refactored tweak application flow to await NvidiaProfileInspector Improved IPC listener cleanup to correctly remove specific listeners Fixed online status not updating after successful network requests Updated system info tests to support backend caching Removed electron-toolkit utils dependency in favor of internal is.dev helper Fixed unwanted files and folders being included in application bundles Download: Sparkle 2.20.1 | Portable | ~100.0 MB (Open Source) Links: Sparkle Website | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Never used the G7 Pro, but I've never had a good experience with that style of d-pad and fighting games.
    • And I just bought a seat cushion for my mesh chair. The chair feels nice but the first time I sat in it with boxers, I realized I don't like the feel of mesh on my legs. 😂
    • "This Dell 27 inch 4K 120Hz IPS monitor is really cheap after a very long time" ... Lol.
  • Recent Achievements

    • Dedicated
      Asgardi earned a badge
      Dedicated
    • Conversation Starter
      jessse3334 earned a badge
      Conversation Starter
    • Reacting Well
      JuvenileDelinquent earned a badge
      Reacting Well
    • One Month Later
      Excellence2025 earned a badge
      One Month Later
    • Week One Done
      Excellence2025 earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      499
    2. 2
      +Edouard
      247
    3. 3
      PsYcHoKiLLa
      153
    4. 4
      Steven P.
      84
    5. 5
      macoman
      64
  • Tell a friend

    Love Neowin? Tell a friend!