Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GetWebResourceUrl only working on one page, but no others. Assign the type and it works.

Reply
Thread Tools

GetWebResourceUrl only working on one page, but no others. Assign the type and it works.

 
 
Chris Auer
Guest
Posts: n/a
 
      10-16-2007
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

 
Reply With Quote
 
 
 
 
Chris Auer
Guest
Posts: n/a
 
      10-16-2007
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GetWebResourceUrl not working matt_randle@yahoo.com ASP .Net 2 08-02-2007 05:15 PM
GetWebResourceUrl and MasterPage cruster ASP .Net 0 02-14-2007 11:37 AM
GetWebResourceUrl and dynamic resources Jeremy Chapman ASP .Net 3 05-01-2006 03:56 PM
One-to-one static IP assign on Cisco router Mirek Cisco 7 02-18-2004 07:08 PM
Search a keyword but but only on one kind of tag Marc Pichouron Javascript 0 01-08-2004 08:40 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57