Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I call a javascript file that's embedded in a dll in my asp.net web application?

In a library I am building for my asp.net, is it possible to embed a javascript file as an embedded resource and still be able to retrieve it via a URL call and/or script tag without creating a secondary ashx just to load the javascript?

like image 256
KallDrexx Avatar asked Nov 28 '12 15:11

KallDrexx


People also ask

How do I reference a JavaScript file in aspx?

Just add the script tags in the master page or content page and the javascripts can be included in them. If you want to add a JavaScript file to them, you can use src attribute in the script tag.

Which method enables you to add a reference to a JavaScript file embedded in an assembly?

To embed a client script file in an assembly. In Visual Studio, create a new class library project named SampleControl. Add references to the System. Web, System.

HOW include js file in ASP.NET MVC?

The recommended approach is to put in a separate JavaScript file or inside a section defined in Layout page. A section can be added in the MVC Layout page using @RenderSection() directive. For example, we can define a section in Layout page under <head> tag for scripts like below.

Does ASP.NET need JavaScript?

ASP.NET requires the use of the client-side Javascript, as that's how ASP.NET handles its Events via PostBacks.


1 Answers

It's entirely possible.

A quick google came up with this really good tutorial Managing Your JavaScript Library in ASP.NET

like image 170
Darren Wainwright Avatar answered Oct 29 '22 17:10

Darren Wainwright