Wednesday, March 21, 2012

DropDownExtender throwing 404 "File does not exist" error

I have used DropDownExtender in my projects and it works fine. However if I check the HTTP log using Web Development Helper (fromwww.nikhilk.net), I find a 404 response as it tries to get a file/resource "null" from the current folder (e.g. SampleWebSite/DropDown/null). I can get the same "error" when I run the sample web site of AjaxControlToolkit. Is this a bug? Although it works fine even with the 404 response, it bothers me because my application does catch it and log it in the event log.

Hope someone can tell me how to get rid of the 404 response.

Thanks

Edwin

Hi Edwin,

This is the internal behavior of the DropDownExtender control. The request is sent by an image element( the dropdown image ).

Initially, the img element's src is set to null, thus the browser sends a request to currentRootFolder/null for it.

When you move the mouse over it, its src is changed to a valid image ( by default, a triangle ).

When a postback happens, the img element is reinitialized to null again.

That's why you will see a 404 response.

It's not encouraged to change the source code/internal behavior of the DropDownExtender to get rid of it, because inappropriate change may bring a bigger trouble.

How do you enable logging on your application? It will be better if you can apply a filter to it. For instance, don't log the one whose request contain a url like "folderName/null"

Hope this helps.


Hi Raymond

What you described is the function of the DropDownExtender but I believe the 404 response can be avoided rather than being a "normal" occurence. I have posted the issue on codeplex (http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=11521) and hope this may help those who encountered the same problem.

Edwin

No comments:

Post a Comment