Home Web Front-end JS Tutorial The specific implementation method of using jquery to access photos_jquery

The specific implementation method of using jquery to access photos_jquery

May 16, 2016 pm 05:30 PM
jquery access photo

1. Use jquery to call the function in aspx:

Copy the code The code is as follows:

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
Copy code The code is as follows:

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

The code is as follows: [WebMethod(EnableSession = true)] //AJAX call must be a function declared in this way EnableSession--》Use Session to access photospublic static void DoSave (){ byte[] byZhaoPian; byZhaoPian = (byte[])(HttpContext.Current. Session["image"]);                                                   🎜>catch                                                                                  >
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
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to sort photos by favorites in Windows 11 How to sort photos by favorites in Windows 11 Mar 18, 2024 am 09:37 AM

In this article, we will explain how to sort photos using the Favorites feature in Windows 11. The Photos app in Windows offers a convenient feature that allows you to mark specific photos or videos as Favorites or Preferences. Once you mark these items as favorites, they are automatically organized into a separate folder, allowing you to easily browse your favorite content without having to hunt through your entire photo library. This feature enables you to quickly access and manage your favorite photos and videos, saving you a lot of time and effort. Normally, photos in the Favorites folder are sorted by date in descending order, so that the newest photos appear first, followed by older photos. However, if you wish to focus on

How to disable Face ID or Touch ID for hidden and recently deleted photos on iPhone How to disable Face ID or Touch ID for hidden and recently deleted photos on iPhone Mar 04, 2024 pm 04:40 PM

Apple's Photos app offers a feature that locks photos in Hidden and Recently Deleted albums to ensure they're hidden from prying eyes. This provides an extra layer of protection for the sensitive photos and videos you may have stored in those albums because they are locked behind your iPhone's Face ID, Touch ID, or device passcode. If you have difficulty accessing Hidden and Recently Deleted albums using this lock feature, you may consider disabling it to make the content more accessible. This article will explain to you in detail how to disable FaceID or TouchID authentication for Photos app on iPhone. How to disable Face ID or Touch ID for the Photos app Required: Running iOS 16 or later

What should I do if the 'Unable to upload' message appears in the iPhone 'Photos' app? What should I do if the 'Unable to upload' message appears in the iPhone 'Photos' app? Feb 28, 2024 pm 09:00 PM

If you turn on the iCloud photo function, the photos and videos taken on your iPhone will be synchronized to Apple servers for storage. However, during the synchronization process to iCloud, a "Unable to upload" prompt or album may appear. Usually, this status will be displayed at the bottom of the iPhone Photos app, with a prompt saying "Unable to sync [number] items to iCloud." A new album named "Cannot Upload" will be added in the "Photos" App. To add these photos or videos to iCloud Photos, you can try exporting them from the Photos App and then re-importing them. Note, however, that any edits or keywords previously applied to these photos or videos will be lost. on iPhone

How to make photos black and white with Meitu Camera How to make photos black and white with Meitu Camera Mar 28, 2024 am 09:11 AM

In this colorful world, sometimes we also long for the simple black and white beauty. As a classic image processing method, black and white filters can not only give photos a retro and elegant atmosphere, but also highlight the theme and emotion of the picture through contrast and changes in light and shade. Meitu Xiuxiu, as a popular image processing software, provides us with the function of easily adding black and white filters. So for users who want to add but don’t know how to add it yet, the editor of this website will bring you a detailed step-by-step introduction below. Come and follow this article to add it! How to turn photos into black and white on mobile phone Meitu Xiuxiu. First we need to open Meitu Xiuxiu on the mobile phone. After entering the main interface, select "Beautify Pictures" and select the picture we need to modify. 2. Then click

What should I do if I can't find the photos on my phone when I open the Douyin album? What is the reason why the Douyin album does not display photos? What should I do if I can't find the photos on my phone when I open the Douyin album? What is the reason why the Douyin album does not display photos? Mar 21, 2024 pm 05:20 PM

In the digital age, photos and videos have become an important way for us to record our lives and express our emotions. As the leading short video platform in China, Douyin allows users to easily share their lives in the form of short videos. Some users find that they cannot find the photos on their phones when they open the Douyin album, which undoubtedly brings some trouble to their experience. So, how should we solve this situation? What causes this to happen? This article will discuss these two issues in detail. 1. What should I do if I can’t find the photos on my phone when I open the Douyin album? When users cannot find photos on their phone in the Douyin album, they can try the following methods to solve the problem: Check photo permissions: Please make sure the Douyin app is allowed to access the album in the phone settings

AI video explodes again! Photo + voice turned into video, Alibaba asked the heroine Sora to sing and rap with Li Zi. AI video explodes again! Photo + voice turned into video, Alibaba asked the heroine Sora to sing and rap with Li Zi. Feb 29, 2024 pm 07:07 PM

After Sora, there is actually a new AI video model, which is so amazing that everyone likes it and praises it! With this picture, Gao Qiqiang, the villain of "Hurry Up" transformed into Luo Xiang, can educate everyone (dog head). This is Alibaba’s latest audio-driven portrait video generation framework, EMO (EmotePortraitAlive). With it, you can generate an AI video with vivid expressions by inputting a single reference image and a piece of audio (speech, singing, rap, etc.). The final length of the video depends on the length of the input audio. You can ask Mona Lisa, a veteran contestant of AI effects experience, to recite a monologue: The young and handsome DiCaprio performs a fast-paced RAP talent show, and there is no problem in keeping up with the mouth shape: even the Cantonese mouth shape

How to use PUT request method in jQuery? How to use PUT request method in jQuery? Feb 28, 2024 pm 03:12 PM

How to use PUT request method in jQuery? In jQuery, the method of sending a PUT request is similar to sending other types of requests, but you need to pay attention to some details and parameter settings. PUT requests are typically used to update resources, such as updating data in a database or updating files on the server. The following is a specific code example using the PUT request method in jQuery. First, make sure you include the jQuery library file, then you can send a PUT request via: $.ajax({u

How to know if a photo was clicked in night mode on iPhone How to know if a photo was clicked in night mode on iPhone Feb 29, 2024 pm 04:31 PM

Apple's native camera app on iOS comes with a night mode that allows users to adjust the ISO, aperture and shutter speed of images to take bright and clear photos even in low-light environments. This feature results in pictures that are so high quality that others may have trouble telling that the photo was taken in night mode. So, how do you find out which photo was clicked in night mode? This is what we will explain in this article. What is night mode in iOS camera? To capture low-light subjects, photographers can play cleverly with camera settings. By adjusting the aperture, ISO value and shutter speed, you can extend the exposure time of the sensor and allow the camera to receive more light. Increasing the aperture allows more

See all articles