Image upload with ajax and asp.net returns html
I'm trying to build simple image upload to server. Page is basic asp.net page with webforms. HTML Code - Works fine <div> <input type="file" id="myPhoto" /> <input type="button" id="upload" value="Upload" /> </div> In backend my code in dog.aspx is [WebMethod(EnableSession = true)] public static string uploadDoc(HttpPostedFileBase file) { try { string _file = mkStorage.UploadImg(file); return _file; } catch (Exception e) { return e.Message; } } And the problem I have with jQuery ajax call. It only returns full page to console as a html. It wont even call the WebMethod because my brakepoint