html - WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive) -


i'm building web application using visual studio 2012. i'm attempting add word count textbox. after adding the javascript codes , html codes. receive error stated above.

here javascript codeds

code :

function validatelimit(obj, divid, maxchar) {  objdiv = get_object(divid);  if (this.id) obj = this;  var remaningchar = maxchar - trimenter(obj.value).length;  if (objdiv.id) {     objdiv.innerhtml = remaningchar + " characters left"; } if (remaningchar <= 0) {     obj.value = obj.value.substring(maxchar, 0);     if (objdiv.id) {         objdiv.innerhtml = "0 characters left";     }     return false; } else { return true; } }  function get_object(id) { var object = null; if (document.layers) {     object = document.layers[id]; } else if (document.all) {     object = document.all[id]; } else if (document.getelementbyid) {     object = document.getelementbyid(id); } return object; }  function trimenter(datastr) { return datastr.replace(/(\r\n|\r|\n)/g, ""); } 

server codes in master page

<script type="text/javascript" src="js/jscript.js" ></script> 

aspx codes, ( html codes )

<tr> <th style="width: 595px; height: 135px;">official report :</th> <td colspan="4" style="height: 135px">   <asp:textbox id="tbofficial" runat="server" height="121px" textmode="multiline" width="878px" maxlength="500"   tooltip="summary:(500 characters)" onkeyup="return validatelimit(this, 'lblmsg1', 500)" ></asp:textbox>   <div id="lblmsg1">500 characters left</div> <asp:requiredfieldvalidator id="requiredfieldvalidator1" runat="server"          controltovalidate="tbofficial" display="dynamic"          setfocusonerror="true">*</asp:requiredfieldvalidator>   <br />   <asp:label id="lblmsg" runat="server"></asp:label>   <br />   <br />         <asp:button id="btnsubmit" runat="server" text="submit" onclick="btnsubmit_click" />   <asp:button id="btnclear" runat="server" text="clear" onclick="btnclear_click" />         </td> </tr> 

you need web.config key enable pre 4.5 validation mode.

more info on validationsettings:unobtrusivevalidationmode:

specifies how asp.net globally enables built-in validator controls use unobtrusive javascript client-side validation logic.

type: unobtrusivevalidationmode

default value: none

remarks: if key value set "none" [default], asp.net application use the pre-4.5 behavior (javascript inline in pages) client-side validation logic. if key value set "webforms", asp.net uses html5 data-attributes , late bound javascript added script reference client-side validation logic.

example:

    <appsettings>       <add key="validationsettings:unobtrusivevalidationmode" value="none" />     </appsettings> 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -