By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

How to Get WebResources.axd working on IIS on XP Pro

P: n/a
I'm trying to figure out what I need to do to configure IIS 5.1 on XP Pro to
work when referencing WebResources.axd.

For example, I have an aspx script that works fine when run from Visual Web
Developer 2005 (Express Edition) built-in web server, but fails when run
under IIS (same file, same location).

I think I've tracked the problem to a failure of IIS to find
WebResources.axd. For example, if I point IE to the src centerated by the
Visual Web Developer server:

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

it returns the proper javascript code.

However, I point IE to the source generated by IIS:

localhost/WebResource.axd?d=-n9cHn2it-BTUPcvYkgh0g2&t=632744679945312500

I get a file not found error.

What do I need to do to configure IIS to properly work with WebResources.axd?

Any suggestions would be greatly appreciated.

Some comments on installation:

ASP.Net 2.0 was installed on XP via Windows Update

I checked web.config and it has the following line (I'm changing angle
brackets to square brackets for this post to prevent display problems):

[add path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" validate="True" /]

In IIS under application configuration mappings, there was no entry for .axd
I tried adding the following to see if it would help, but it didn't (I got
the same file not found problem I had when this entry wasn't there):

.axd c:\windows\microsoft.net\framework\v2.0.50727\aspn et_isapi.dll
Limit to: GET,HEAD,POST,TRACE
Script Engine; Check if file exists

One work-around I've managed is to point my Visual Web Developer server to

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

get the javascript code, save it as a physical file WebResource.axd so that
when my .aspx script runs on IIS it's code will access the physical file and
run correctly, however, I know this is not a "good" way to make things work :)

Any suggestions as to how I can get my IIS configured properly so that it
returns the WebResource.axd file would be greatly appreciated.

Thanks.

Mar 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
re:
What do I need to do to configure IIS to properly work with WebResources.axd?
You don't need to do anything, unless you have very specific needs.

WebResource.axd will be populated automatically
with whatever script resources your objects need.

WebForms.js is an embedded resource inside System.Web.dll,
and it is served using the new WebResource.axd handler.

WebResource.axd is a built-in HTTP handler in ASP.NET 2.0
that's used to retrieve script code into pages.

It doesn't need to be used directly, although it can be.

This handler guarantees that all the script code necessary to perform
the callback is correctly referenced within the page or control.

In particular, WebResource.axd ensures that calls to WebForm_DoCallback
and WebForm_InitCallback are successfully resolved.

If you want to take a look at the real source code behind script callbacks
in ASP.NET 2.0, open the Temporary Internet Files folder on your Web
server machine and look up the file WebResource.axd.

There will be several there.

The code injected through this HTTP handler represents the
callback manager in charge of sending the request and handling the results.

See http://msdn.microsoft.com/msdnmag/is...8/CuttingEdge/
for a code example.

Also, check out Peter Bromberg's article at :
http://www.eggheadcafe.com/articles/20050528.asp

Rick Strahl shows you how to embed your own resources for use with WebResources.axd :
http://west-wind.com/weblog/archive/01302006.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"RobertS" <Ro*****@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com... I'm trying to figure out what I need to do to configure IIS 5.1 on XP Pro to
work when referencing WebResources.axd.

For example, I have an aspx script that works fine when run from Visual Web
Developer 2005 (Express Edition) built-in web server, but fails when run
under IIS (same file, same location).

I think I've tracked the problem to a failure of IIS to find
WebResources.axd. For example, if I point IE to the src centerated by the
Visual Web Developer server:

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

it returns the proper javascript code.

However, I point IE to the source generated by IIS:

localhost/WebResource.axd?d=-n9cHn2it-BTUPcvYkgh0g2&t=632744679945312500

I get a file not found error.

What do I need to do to configure IIS to properly work with WebResources.axd?

Any suggestions would be greatly appreciated.

Some comments on installation:

ASP.Net 2.0 was installed on XP via Windows Update

I checked web.config and it has the following line (I'm changing angle
brackets to square brackets for this post to prevent display problems):

[add path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" validate="True" /]

In IIS under application configuration mappings, there was no entry for .axd
I tried adding the following to see if it would help, but it didn't (I got
the same file not found problem I had when this entry wasn't there):

.axd c:\windows\microsoft.net\framework\v2.0.50727\aspn et_isapi.dll
Limit to: GET,HEAD,POST,TRACE
Script Engine; Check if file exists

One work-around I've managed is to point my Visual Web Developer server to

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

get the javascript code, save it as a physical file WebResource.axd so that
when my .aspx script runs on IIS it's code will access the physical file and
run correctly, however, I know this is not a "good" way to make things work :)

Any suggestions as to how I can get my IIS configured properly so that it
returns the WebResource.axd file would be greatly appreciated.

Thanks.

Mar 3 '06 #2

P: n/a
Many thanks for the response, but let me try to clarify the problem. The
problem I'm trying to solve is that the WesResouce.axd is not being access
automatically when my aspx script is run in IIS (it is in Visual Web
Developer).

You are correct that the code to access WebResources.axd is being properly
generated, I can see this by viewing the source in IE:

When run via IIS:

[script
src="/WebResource.axd?d=-n9cHn2it-BTUPcvYkgh0g2&t=632744679945312500"
type="text/javascript"][/script]

When run via Visual Web Developer built-in server:

[script
src="localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500" type="text/javascript"][/script]

The problem is, when running under IIS, IIS returns a message that
WebResource.axd cannot be found and so no javascript code is returned to IE
and so the page fails to work.

When run under Visual Web Developer built-in serever, WebResource.axd is
found and the javascript is returned so the page works.

Somehow I suspect that IIS is not properly seeing the

[add path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" validate="True" /]

line in web.config or that System.Web.Handlers.AssemblyResouceLoader is for
some reason not working in IIS since if I take the javascript code that is
returned from WebResource.axd when run under Visual Web Developer built-in
server and save it as a real file called WebResource.axd and then use IIS,
IIS will read the saved WebResource.axd file and work properly. This would
seem to me to indicate that

[add path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" validate="True" /]

is not working properly in IIS, since IIS appears not to be using
System.Web.Handlers.AssemblyResourceLoader when WebResources.axd is
referenced, but instead is still looking for a real file named
WebResources.axd.

Any suggestions or further clues on how to solve the problem would be
appreciated.

Many Thanks.


"Juan T. Llibre" wrote:
re:
What do I need to do to configure IIS to properly work with WebResources.axd?


You don't need to do anything, unless you have very specific needs.

WebResource.axd will be populated automatically
with whatever script resources your objects need.

WebForms.js is an embedded resource inside System.Web.dll,
and it is served using the new WebResource.axd handler.

WebResource.axd is a built-in HTTP handler in ASP.NET 2.0
that's used to retrieve script code into pages.

It doesn't need to be used directly, although it can be.

This handler guarantees that all the script code necessary to perform
the callback is correctly referenced within the page or control.

In particular, WebResource.axd ensures that calls to WebForm_DoCallback
and WebForm_InitCallback are successfully resolved.

If you want to take a look at the real source code behind script callbacks
in ASP.NET 2.0, open the Temporary Internet Files folder on your Web
server machine and look up the file WebResource.axd.

There will be several there.

The code injected through this HTTP handler represents the
callback manager in charge of sending the request and handling the results.

See http://msdn.microsoft.com/msdnmag/is...8/CuttingEdge/
for a code example.

Also, check out Peter Bromberg's article at :
http://www.eggheadcafe.com/articles/20050528.asp

Rick Strahl shows you how to embed your own resources for use with WebResources.axd :
http://west-wind.com/weblog/archive/01302006.aspx

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"RobertS" <Ro*****@discussions.microsoft.com> wrote in message
news:88**********************************@microsof t.com...
I'm trying to figure out what I need to do to configure IIS 5.1 on XP Pro to
work when referencing WebResources.axd.

For example, I have an aspx script that works fine when run from Visual Web
Developer 2005 (Express Edition) built-in web server, but fails when run
under IIS (same file, same location).

I think I've tracked the problem to a failure of IIS to find
WebResources.axd. For example, if I point IE to the src centerated by the
Visual Web Developer server:

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

it returns the proper javascript code.

However, I point IE to the source generated by IIS:

localhost/WebResource.axd?d=-n9cHn2it-BTUPcvYkgh0g2&t=632744679945312500

I get a file not found error.

What do I need to do to configure IIS to properly work with WebResources.axd?

Any suggestions would be greatly appreciated.

Some comments on installation:

ASP.Net 2.0 was installed on XP via Windows Update

I checked web.config and it has the following line (I'm changing angle
brackets to square brackets for this post to prevent display problems):

[add path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" validate="True" /]

In IIS under application configuration mappings, there was no entry for .axd
I tried adding the following to see if it would help, but it didn't (I got
the same file not found problem I had when this entry wasn't there):

.axd c:\windows\microsoft.net\framework\v2.0.50727\aspn et_isapi.dll
Limit to: GET,HEAD,POST,TRACE
Script Engine; Check if file exists

One work-around I've managed is to point my Visual Web Developer server to

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

get the javascript code, save it as a physical file WebResource.axd so that
when my .aspx script runs on IIS it's code will access the physical file and
run correctly, however, I know this is not a "good" way to make things work :)

Any suggestions as to how I can get my IIS configured properly so that it
returns the WebResource.axd file would be greatly appreciated.

Thanks.


Mar 3 '06 #3

P: n/a
OK, problem found and solved:

When ASP.Net 2.0 was installed (via Windows Update), it did not put and
entry for the .axd file type in IIS under directory, configuration, mappings.

Actually I had discovered this days ago and put in the entry by duplicating
the entry for .aspx -- that didn't work so I went off on another long
debugging tangent with the web.config file, which eventually led me back to
the IIS entry for .axd -- the critical problem was the "Check that file
exists" box must not be checked (obviously -- once I think about it).

Anyway once the entry:

..axd

c:\windows\microsoft.net\framework\v2.0.50727\aspn et_isapi.dll

limit to: GET, HEAD, POST, TRACE

Script Engine

was added to the IIS configuration, everything started to work.

"RobertS" wrote:
I'm trying to figure out what I need to do to configure IIS 5.1 on XP Pro to
work when referencing WebResources.axd.

For example, I have an aspx script that works fine when run from Visual Web
Developer 2005 (Express Edition) built-in web server, but fails when run
under IIS (same file, same location).

I think I've tracked the problem to a failure of IIS to find
WebResources.axd. For example, if I point IE to the src centerated by the
Visual Web Developer server:

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

it returns the proper javascript code.

However, I point IE to the source generated by IIS:

localhost/WebResource.axd?d=-n9cHn2it-BTUPcvYkgh0g2&t=632744679945312500

I get a file not found error.

What do I need to do to configure IIS to properly work with WebResources.axd?

Any suggestions would be greatly appreciated.

Some comments on installation:

ASP.Net 2.0 was installed on XP via Windows Update

I checked web.config and it has the following line (I'm changing angle
brackets to square brackets for this post to prevent display problems):

[add path="WebResource.axd" verb="GET"
type="System.Web.Handlers.AssemblyResourceLoader" validate="True" /]

In IIS under application configuration mappings, there was no entry for .axd
I tried adding the following to see if it would help, but it didn't (I got
the same file not found problem I had when this entry wasn't there):

.axd c:\windows\microsoft.net\framework\v2.0.50727\aspn et_isapi.dll
Limit to: GET,HEAD,POST,TRACE
Script Engine; Check if file exists

One work-around I've managed is to point my Visual Web Developer server to

localhost:2317/WebResource.axd?d=sbmgIrZc4GkisHONnrRdTA2&t=632744 679945312500

get the javascript code, save it as a physical file WebResource.axd so that
when my .aspx script runs on IIS it's code will access the physical file and
run correctly, however, I know this is not a "good" way to make things work :)

Any suggestions as to how I can get my IIS configured properly so that it
returns the WebResource.axd file would be greatly appreciated.

Thanks.

Mar 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.