[RESOLVED]convert Razor IsPost to Ajax Post

I have the following action on a page that allows a user to follow and unfollow another user, but the form processes on the same page and refreshes, which I do not want for austerity and convenience sake.. Can I get help with the AJAX method

var count= Convert.ToInt32(db.QueryValue("select * from Following WHERE User_Id=@0 and UserID=@1",visitor.UserID,WebSecurity.GetUserId(WebSecurity.CurrentUserName)));
    var sql = @"INSERT INTO Following (User_ID,UserID) VALUES (@0,@1)";
        string currentUrl =  Request.Url.LocalPath;
    <form action="" method="post">
    <div class="hero-actions button-set">
<div><input class='btnn btn-default btn-round-lg btn-lg' id='@nav.UserID' name="follow" type="submit" value="Follow"></div>
<div style='display:none'><input class='btnn btn-default btn-round-lg btn-lg del' id='@nav.UserID' value="Following" name="following" type="submit"></div>

I would go on with it this way

Leave a Reply