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 );