Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris Auer - 16 Oct 2007 17:05 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.