I have a custom control that has a webresource in it.
The webresource is a javascript file and I have the build option on the javascript file set to "Embedded Resource" and I have the following lines of code in my AssemblyInfo.cs for the project my custom control is in:
// Export the MultiSelectGridView.js file
[assembly: WebResource("SOM.DCO.CustomWebControls.MultiSelectGridView.js", "application/x-javascript")]
In my custom control, I have the following lines in the overriden onload event:
private const string MULTISELECTGRIDVIEW_JS = "SOM.DCO.CustomWebControls.MultiSelectGridView.js";
Type t = this.GetType();
string url = Page.ClientScript.GetWebResourceUrl(t, MULTISELECTGRIDVIEW_JS);
if (!Page.ClientScript.IsClientScriptIncludeRegistered(t, MULTISELECTGRIDVIEW_JS))
Page.ClientScript.RegisterClientScriptInclude(t, MULTISELECTGRIDVIEW_JS, url);
I've also tried the following:
private const string MULTISELECTGRIDVIEW_JS = "SOM.DCO.CustomWebControls.MultiSelectGridView.js";
if (!Page.ClientScript.IsClientScriptIncludeRegistered(t, MULTISELECTGRIDVIEW_JS))
Page.ClientScript.RegisterClientScriptResource(t, MULTISELECTGRIDVIEW_JS);
Unfortunately, no matter what I do, the webresource that I get back is blank, and so none of the functions in my javascript file are included/defined in my consuming page.
Am I missing something obvious?