I have 2 pages in ASP.Net
The first page has some .Net controls and therefore renders out the javascript includes for WebResource.axd
The other page does not render any .Net controls and has some custom javascript that generates some html. This includes validators and other .Net controls as the WebResource.axd was not rendered initially and there has been no postback I am having problems submits validators etc.
The question is how does IIS or .Net work out that it needs to generate the WebResource.axd so I can make my new page render this even though initially .Net does not think it is needed.
The WebResource.axd gets added to your pages that contain .Net controls with embedded resources. So, if you have a page that has no controls with embedded resources, i.e.- just standard HTML, you will not see WebResource file.
Here's a good blog on how it works: http://scottonwriting.net/sowblog/archive/2010/10/28/just-where-is-webresource-axd.aspx
Includes of the WebResource.axd will be added by the controls (who need it) itself. They will not be added by IIS or the underlying ASP.NET framework.
So for example if a control has a dependency on a embedded webresource it will do something like this:
string scriptUrl = Page.ClientScript.GetWebResourceUrl(this.GetType(), "RESOURCE_NAME.js")
Page.ClientScript.RegisterClientScriptInclude("RESOURCE_NAME.js", scriptUrl);
It looks like you created a dependency on a web resource which doesn't get included because you didn't ask for it. It works on the first page only because of the fact the other control on your first page also need it.
So before you can continue you need to know which web resource you need and then include it yourself. The only problem I have with this solution is that you are using a web resource which is not in your control. So if you can write it yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With