I have an IP logger that logs every request on my site. I have an aspx file and all there is on the page is a login control. Sometimes, I see that the user requests files WebResource.axd and ScriptResource.axd.
What are these files? Should I be worried about why people need these files? Is there a way to make those files not load?
This is the code that gets injected into the source:
<form method="post" action="Login.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE0MDY3MDIxMTJkZP4uWZ4lXNuyuRrV4WrElW0ggocM1I3JRIQCWFIn//pc" />
</div>
<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
theForm.__EVENTTARGET.value = eventTarget;
theForm.__EVENTARGUMENT.value = eventArgument;
theForm.submit();
}
}
//]]>
</script>
<script src="/DevSite/WebResource.axd?d=i71SGerEFS7KkmOK1EZlseUozP8wtn-WVT5cKzU7gwBrQo1eh4fne20ms2gsTvxKJQfMBdJy2qa4usXog-laO5ZGY1F1vwWhGm6DyMBpmiw1&t=634485133519310893" type="text/javascript"></script>
<script src="/DevSite/WebResource.axd?d=ykdqe6jXivz0IwSUsLMAB7y0B76JMCYJZQUmDdoIbJPye1bBU-uHKTBm3XnHHgRJW9Ra53bZSSw62IBaELjdI2whgbYdvnEPM3_ktH9BQsU1&t=634485133519310893" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function WebForm_OnSubmit() {
if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
return true;
}
//]]>
</script>
<div class="aspNetHidden">
<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBALCo9CRAwKS/bz1BgLuoqaLBgKc0OKsAZKG95K3r5LqRnx111ak6bZw5s8X0RNEbBkGVGmv1i6j" />
</div>
Ideally, I’d like to get rid of these dependencies. Is it possible?
Thanks.
These are handlers that render out script, CSS, and other resource files embedded in DLL’s, so that the browser can read the file. Essentially, the handler extracts them from the DLL, and streams the content to the client.
Most common uses are the ASP.NET AJAX framework, which you get when you define a ScriptManager control. Also, most common frameworks embed their scripts into the DLL, and they are defined this way (AjaxControlToolkit and most third party frameworks).
So it wouldn’t be a good thing to delete these; otherwise, JavaScript will start failing 🙂