Asp.net Learning Log

Source: Internet
Author: User

1. Page Switching

Response. Redirect ("dir. aspx"); // redirect to the Dir. ASPX page

2. output the image to the page,

Protected void page_load (Object sender, eventargs E)
{
/// Specify the address of the output image
String Path = request. mappath ("~ /Images/xpbz0075.jpg ");
/// Create a file stream to read the image
Filestream FS = new filestream (path, filemode. Open, fileaccess. Read );
/// Define a binary array for storing image data
Byte [] imagedata = new byte [(INT) fs. Length];
/// Read the binary data of the object
FS. Read (imagedata, 0, (INT) fs. Length );
/// Output the binary data of the image
Response. binarywrite (imagedata );
/// Set the output format of the page. [note]: Only JPG images can be output here.
Response. contenttype = "image/pjpeg ";
Response. End (); // stop other output on the page
}

3. Asp.net: the correct method for obtaining the current URL

Url = httpcontext. Current. Request. url. pathandquery + "? Name = "+ textbox1.text +" & Email = "+ textbox2.text;
Response. Redirect (URL );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.