You need to ensre that the JavaScript file is included in the assembly

You create an ASP.NET server control in the SampleControl namespace. The control uses a JavaScript
file names Refresh.js to implement AJAX functionality. You need to ensre that the JavaScript file is
included in the assembly. Which two actions should you perform (Choose 2)

You create an ASP.NET server control in the SampleControl namespace. The control uses a JavaScript
file names Refresh.js to implement AJAX functionality. You need to ensre that the JavaScript file is
included in the assembly. Which two actions should you perform (Choose 2)

A.
Add the following assembly attribute to the AssemblyInfo file.
[assembly: WebResource(“SampleControl.Refresh.js”,
“application/x-javascript”)]

B.
Add the following assembly attribute to the AssemblyInfo file.
[assembly:ScriptResource(“SampleControl.Refresh.js”)]

C.
In the Properties window for the Refresh.js file, set the Build Action to Embedded Resource.

D.
In the Properties window for the Refresh.js file, set the Build Action to Content.

Explanation:
from vs metadata
// Summary:
// Defines a resource in an assembly to be used from a client script file. This
// class cannot be inherited.
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public sealed class ScriptResourceAttribute : Attribute



Leave a Reply 0

Your email address will not be published. Required fields are marked *