Objectmix
Tags Register Mark Forums Read

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...


Object Mix > Framework and Interface Programming > DOTNET > GetWebResourceUrl only working on one page, but no others. Assign the type and it works.

DOTNET Discussion forums related to Microsoft Dot net technologies, CSharp and other related items

Reply

 

LinkBack Thread Tools
  #1  
Old 10-16-2007, 11:05 AM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default GetWebResourceUrl only working on one page, but no others. Assign the type and it works.

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

  #2  
Old 10-16-2007, 01:33 PM
Junior Member
 
Join Date: Nov 2009
Posts: 0
Application Development is on a distinguished road
Default Re: GetWebResourceUrl only working on one page, but no others. Assign the type and it works.

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.

Reply

Thread Tools


Similar Threads

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


All times are GMT -5. The time now is 08:49 AM.

Managed by Infnx Pvt Ltd.