You can access your website using the following methods.
I. C # code 1
String url = Request ["referer"];
Response. Write ("alert ('" url "')");
Response. End ();
Or directly use
Top. location. href
You can also use one of the following four methods:
HttpRequest. UrlReferrer
Request. UrlReferrer. AbsolutePath
HttpContext. Current. Request. Url. ToString ()
Request. ServerVariables ["Http_Referer"] can get the link address of the previous page
Ii. HTML code
<Script>
Var url = 'js. aspx? Referer = 'encodeuricomponent (document. referrer );
Document. write ('<''script type = "text/java script" src = "'url'"> <''/script> ');
</Script>
Iii. xmlhttp code
Var objXMLHTTP = new ActiveXObject ("MICROSOFT. XMLHTTP ");
Var url = "http://www.dzwebs.net/" "se. asp? Temp = "name1.value" & id = "name2.value" & len = "name3.value;
ObjXMLHTTP. open ("GET", url, false );
ObjXMLHTTP. send ();
Var strReturn = objXMLHTTP. ResponseText;
If (strReturn = "error ")
{Alert ("there is error occurred! ");
}
Original article: http://www.amhl.net/wenzhang/DianNao-BianChengKaiFa/20110419/175529.html