On Oct 16, 12:05 pm, Chris Auer <chris.a...@gmail.com> wrote:
> I have one page that gets its contents from a class called
> FormBuilder.cs. It generates a web part. On that page
> GetWebResourceUrl works fine. All other pages generates an invalid
> assembly key. If I change the type to the working class I can make it
> work on any page.
>
> Works
> string scriptLocation =
> Page.ClientScript.GetWebResourceUrl(typeof(FormsBu ilderWebPart.FormBuilder)*,
> "FormsBuilderWebPart.JScript1.js");
> Page.ClientScript.RegisterClientScriptInclude("For msBuilderWebPart.JScript1*.js",
> scriptLocation);
>
> Does not Work
> string scriptLocation = Page.ClientScript.GetWebResourceUrl(type,
> "FormsBuilderWebPart.JScript1.js");
> Page.ClientScript.RegisterClientScriptInclude("For msBuilderWebPart.JScript1*.js",
> scriptLocation);
>
> Any idea why the pages and controls keys are not working?
>
> Thanks all
> Chris
I found that you cant use this,GetType in a web application, only
classes. You have to do typeof(MyNameSpace.Class) to get the correct
assembly.
|