GetWebResourceUrl only working on one page, but no others. Assign the type and it works. : DOTNET
This is a discussion on GetWebResourceUrl only working on one page, but no others. Assign the type and it works. within the DOTNET forums in Framework and Interface Programming category; 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...
| DOTNET Discussion forums related to Microsoft Dot net technologies, CSharp and other related items |
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| 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 |
|
#2
| |||
| |||
| 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(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 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. |
![]() |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: How can LabView export Power point file page per page and readit by picture(jpeg type)? | usenet | labview | 0 | 09-19-2007 05:40 AM |
| GetWebResourceUrl not working | usenet | DOTNET | 2 | 08-02-2007 12:16 PM |
| Type assign initial values? | usenet | Fortran | 0 | 06-04-2007 07:00 AM |
| Is it possible to assign permission by Content Type? | usenet | Sharepoint | 0 | 05-04-2007 06:39 PM |
| Plugin stops working in PhotoPaint 12 (but still works in 9) | usenet | Graphics | 5 | 04-27-2004 09:48 PM |


