Scheduled PSN downtime tomorrow in Back Page News

Javascript New Window Help


2 replies to this topic - - - - -

#1 apa1exakis

    Neowinian³

  • 322 posts
  • Joined: 26-November 01

Posted 16 February 2012 - 21:13

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") + "')");
		  
	    }

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


#2 apa1exakis

    Neowinian³

  • 322 posts
  • Joined: 26-November 01

Posted 16 February 2012 - 22:39

I found an alternative solution. No help needed. Thank you.

#3 primexx

    Neowinian ULTRAKILL

  • 11,483 posts
  • Joined: 24-April 05

Posted 18 February 2012 - 05:30

I hope the alternative solution was "get rid of the useless right click restriction and stop popping out new windows", otherwise you're doing it wrong.