views:

155

answers:

1

Hi

I've embedded several views in a library so that I can re-use across projects using this method which works OK:

http://www.wynia.org/wordpress/2008/12/aspnet-mvc-plugins/

But one view usings a Javascript file. I've tried marking this as an embedded resource and adding it AssemblyInfo.cs and then referencing this resource using

<%= ClientScript.GetWebResourceUrl(this.GetType(), "FullPath.FileName.js")%>

This is literally displaying this output in the view

WebResource.axd?d=nUxqfqAUQLabLU54W

I think this is because Im trying to refer to an embedded resource from an embedded resource.

Help appreciated as Im going round in circles..

Steve

A: 

The problem here was with my call to GetWebResourceUrl. I've changed the format to that below and it works fine :)

<script src="<%= ClientScript.GetWebResourceUrl(typeof(Opal.Web.Shared.AClassInMyAssembly), "FullPath.FileName.js")%>" type="text/javascript"></script>

So Ive contained the call in a script tag and changed the type parameter.

Steve Ward