Reputation: 941
I have been having a problem with my ASP.NET web forms page unobtrusive validation NOT working on customer site. Works, however, for me in my VS 2012. Aside from the fact that validation does not work (that is, the requiredfield validation is ignored and empty fields do not stop from submitting the form) another manifestation is the following. When I run the page in IE 11 Developer Tools (DT) -> Network, ScriptResource.axd is NOT loading. That is, in the DT there are 3 lines with ScriptResource.axd?d..... that have Method GET but Result 404 (meaning not loaded, for whatever reasons).
I found what is causing the problem on the customer site. The ASP.NET page has the following section:
<asp:ScriptManager ID="sm1" runat="server">
<Scripts>
<asp:ScriptReference Name="jquery"/>
</Scripts>
</asp:ScriptManager>
When I remove/delete the above section from the .aspx file the Validation works and the IE11 Developer Tools does not have the lines ScriptResource.axd.
My question is, can you think of why removing the above section resolves the problem on customer site? What - if any - negative effects could be if I permanently remove this section?
Upvotes: 0
Views: 686
Reputation: 186
If you are not using UpdatePanel
s or some other Microsoft Ajax Extension (like the AjaxControlToolkit) then there is no harm in removing the ScriptManager
.
If you plan to use UpdatePanels in the future, then you could try removing only the Scripts
tag. And include your Jquery file with a traditional HTML script tag
<script type="text/javascript" src="Scripts/jquery-(your version).min.js"></script>
Upvotes: 1