Home  >  Article  >  Web Front-end  >  Summary of several return methods for calling HttpHanlder_jquery

Summary of several return methods for calling HttpHanlder_jquery

WBOY
WBOYOriginal
2016-05-16 17:08:161222browse

1: If you only need to return string form, such as content, JSON string array, etc.

context.Response.Write(resultPrice.ToString());

2: If you want to return the image, use the form of stream

bitmap.Save(context.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);

3: If a file is returned, such as a txt document, it is provided to the client for download

context.Response.WriteFile("Text instance.txt");

Statement:
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