473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

Oct 16 '07 #1
1 3392
On Oct 16, 12:05 pm, Chris Auer <chris.a...@gmail.comwrote:
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.

Oct 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Workgroups | last post by:
I've got a page where the nature of the beast is such that the user clicks a submit button to ransomize some data in somewhat rapid succession (once per second, give or take). The page generates a...
2
by: laredotornado | last post by:
Hello, I am looking for a cross-browser way (Firefox 1+, IE 5.5+) to have my Javascript function execute from the BODY's "onload" method, but if there is already an onload method defined, I would...
6
by: J Ames | last post by:
I have an ASP.NET (VB) form that has two drop downs, a horizontal rule and a button. The button invokes a stored procedure and several tables are created on the page with data populated. I want...
2
by: tshad | last post by:
I have my error handling set up in Global.asax: Sub Application_Error(Sender As Object, E as EventArgs) In this procedure I call a function in a dll that will write out to a history file. ...
0
by: cruster | last post by:
Hey folks. I'm trying to achieve something like this within MasterPage code- behind: Page.ClientScript.RegisterClientScriptInclude("general", Page.ClientScript.GetWebResourceUrl(GetType(),...
0
by: Mahesh K. Anajni | last post by:
Hi We are working on a multilingual website. it has five URL (one original and four alias) for all the five languages. we are using RewriterRule in web.config to rewrite the Url. All this...
2
by: matt_randle | last post by:
Can anyone tell me why this is not working ? I have an aspx page with the following definition, <asp:ImageButton ID="MenuBtnOpen" ImageUrl='<%#...
1
by: phoenix917 | last post by:
I have been working on this code for 5 days... I have read multiple tutorials and looked at various code. This is my third forum try... :) My instructor refuses to help me. I think it's because...
1
by: Mark B | last post by:
This is my first try at using AJAX. I want the calendars to be enabled if the user checks CheckBox1. It works OK for a normal all page refresh but once I introduced the AJAX code it stopped...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.