0

I am making a web app in which I would like to create my own control. According to [tutorialspoint] there are 5 different types of ASP.NET web controls and I can't decide which to choose.

The control will be responsible for displaying an image downloaded from server and then injecting a js script to client browser. The script will display something on the image. The main problem is that I want to make this control totally standalone and encapsulate the script file in it (in MyProject).

screenshot

As for now, my control inherits from System.Web.UI.WebControls.Image and injecting my script (from control, programmatically, using ScirptManager) demands adding the js file to my WebFormsApp project (but I dont't want to).

The question is - is it possible to encapsulate the js file in my control project? Should I change the type of control I'm currently using?

Patrick Hofman
  • 153,850
  • 22
  • 249
  • 325
YogoWafel
  • 101
  • 2
  • 9
  • See https://msdn.microsoft.com/en-us/library/bb398930.aspx – Oscar Dec 29 '17 at 11:01
  • Went through that - getting a 404 with `[assembly:WebResource("MyProject.my_script.js", "application/x-javascript")]` is it a bad path? – YogoWafel Dec 29 '17 at 11:12
  • Use some decompiler to see the actual path of the resource and set it right. I recommend the free DotPeek from Jetbrains. – Oscar Dec 29 '17 at 11:25

0 Answers0