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(FormsBuilderWebPart.FormBuilder),
"FormsBuilderWebPart.JScript1.js");
Page.ClientScript.RegisterClientScriptInclude("FormsBuilderWebPart.JScript1.js",
scriptLocation);
Does not Work
string scriptLocation = Page.ClientScript.GetWebResourceUrl(type,
"FormsBuilderWebPart.JScript1.js");
Page.ClientScript.RegisterClientScriptInclude("FormsBuilderWebPart.JScript1.js",
scriptLocation);
Any idea why the pages and controls keys are not working?
Thanks all
Chris
Chris Auer - 16 Oct 2007 19:33 GMT
> I have one page that gets its contents from a class called
> FormBuilder.cs. It generates a web part. On that page
[quoted text clipped - 19 lines]
> 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.