Search

Report if embedded resource doesn't exist when calling ClientScript.RegisterClientScriptResource or GetWebResourceUrl by Michael Freidgeim

Closed
as Won't Fix Help for as Won't Fix

3
Sign in to vote
1
Sign in to vote
Sign in
to vote
Type: Suggestion
ID: 102386
Opened: 5/25/2006 9:32:36 PM
Access Restriction: Public
0
Workaround(s)
Currently when calling ClientScript.RegisterClientScriptResource or GetWebResourceUrl with invalid resource name or missing WebResourceAttribute they return visibly valid URL, but calls actually fails with HttpException: This is an invalid webresource request.
Details (expand)
Product Language
English
Version
Visual Studio 2005
Category
Controls
Operating System
Windows Server 2003
Operating System Language
Estonian
Proposed Solution
It will be good to provide better error reporting ( e.g. throwing exception) in case if resource name is invalid or doesn't have WebResourceAttribute entry.
Also documentation for ClientScript.RegisterClientScriptResource or GetWebResourceUrl should highlight that WebResourceAttribute is mandatory
Benefits
Faster Development
Other Benefits
Faster Development
File Attachments
0 attachments
Sign in to post a comment.
Posted by Michael Freidgeim on 5/28/2006 at 7:20 PM
I've posted my custom function (http://geekswithblogs.net/mnf/archive/2006/05/26/79669.aspx) to do validation that ideally framework should do.
Posted by Microsoft on 8/27/2006 at 11:49 PM
Thanks for your feedback on the .NET Framework! S. Somasegar, the Developer Division VP recently wrote in his blog (http://blogs.msdn.com/somasegar/archive/2006/05/18/601354.aspx) about how the next release of the .NET Framework (codename “Orcas”) requires a high degree of backward compatibility and therefore, how we are being very strict about the number and scope of changes that are made in the “Red Bits” during Orcas. Unfortunately, the change suggested requires a change in the red bits category, and so we are not able to implement it in Orcas due to the potential for it to introduce compatibility issues.

We recognize you submitted this issue because of a specific problem you are experiencing with the product, and while we can’t provide a fix for the issue in Orcas, you may find additional useful information by searching or posting to the ASP.NET forums (http://forums.asp.net). Finally, if you submitted this bug because of a blocking problem you’re experiencing and continue to experience, you may want to also open a support call with Microsoft Professional Services (http://support.microsoft.com/?LN=en-us&scid=gp%3Ben-us%3Bofferprophone&x=8&y=14), which is a better support option when you’re experiencing business impact for your problem and are unable to resolve it in a timely manner on forums or other support channels.

Before starting work on the next full release of the .NET Framework, we will review the customer feedback to help us identify and address the top customer requests.

Thanks,
Richard Ersek
Microsoft .NET Framework Team
Posted by Michael Freidgeim on 8/28/2006 at 12:24 AM
If you are going to review the customer feedback later, should you change the resolution to "Postponed" ?
Posted by BrandonHaynes on 1/31/2007 at 6:54 AM
We understand the strong case for backwards-compatability here. Please consider adding a new API function we can use to determine if a web resource exists. If I could do something like Debug.Assert(Page.ClientScript.DoesWebResourceExist(type, string)) I would be a happy man.

As it stands, even as an experienced developer, I know that I need to block off an hour or two of my time whenever it comes time to add the first resource to an assembly that is to be served via this method. It never seems to work properly, and there is little besides trial and error that one can do to correct it.