Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

ajax asp.net core

@section scripts{ <script>    document.forms[0].onsubmit = () => {        let formData = new FormData(document.forms[0]);        var xhr = new XMLHttpRequest();        xhr.onreadystatechange = function() {            if (this.readyState === 4 && this.status === 200) {                alert('Posted using XMLHttpRequest');            }        };        xhr.open('post', '', true);        xhr.send(new URLSearchParams(formData));        return false;    };</script>}
Source by www.learnrazorpages.com #
 
PREVIOUS NEXT
Tagged: #ajax #core
ADD COMMENT
Topic
Name
7+9 =