asp.net mvc - Jquery Ajax not failing after unauthorized post -


मेरे पास एक jquery .jax पोस्ट प्रकार जेसन और एक [प्राधिकृत] विशेषता के साथ एक एमवीसी नियंत्रक है। वापसी पर Jquery "सफलता" उपयोगकर्ता प्रयोक्ता अधिकृत है, लेकिन "असफल" बाहर कभी नहीं किया जाता है। उपयोगकर्ता प्राधिकृत नहीं होने पर कैसे संभाल सकता है?

  $ .ajax ({type: "POST", url: "/ index", डेटा प्रकार: "json", डेटा: {ID: id, नाम: नाम}, सफलता: फ़ंक्शन (डेटा) {...}, विफल: फ़ंक्शन () {...}});  

सही वाक्यविन्यास है:

  $ एजेक्स ({प्रकार: "POST", url: "/ index", डेटा प्रकार: "जेसन", डेटा: {आईडी: आईडी, नाम: नाम}, सफलता: फ़ंक्शन (डेटा) {...}, त्रुटि: फ़ंक्शन ) {...}});  

यहां एक समान पोस्ट है:


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -