1. Use jquery to call the function in aspx:
sajax("***.aspx/DoSave", //A URL address, pointing to the ASPX where the function is located
null,//Parameters, the parameters required by the pointed ASPX function
showSaveResult);/ /jS script executed after successful execution
2. Function sajax
function sajax(url, data, successcallback)
{
$.ajax({ : data,
async: false,
contentType: "application/json;charset=utf-8",
dataType: "json",
success: successcallback,
ode: {
404: function () { alert('page not found'); },
500: function () { alert('Internal server error'); > };
3. Background function:
cs code
Copy code
4. How to assign value to Session["image"]
After selecting the photo, when you click OK to upload, convert the image into binary and assign it to Session["image"]
5. The method of uploading photos will not be written here, please check other articles