PrepAway - Latest Free Exam Questions & Answers

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)

PrepAway - Latest Free Exam Questions & Answers

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