I use ajax post method to send Image to server.
Is it normal Page_Load
event fires when post method is called ?
Don't need to write [WebMethod]
for this ?
By writting below code on Page_Load
I can get Image from ajax:
HttpFileCollection filesColl = Request.Files;
foreach (string uploader in filesColl)
{
HttpPostedFile file = filesColl[uploader];
if (file.ContentLength > 0)
{
SavePhotoDatabase.SaveCVPhoto(file);
}
}
Is it good idea or I should wirte [WebMethod]
?