<script type="text/javascript">
function preventBack() { window.history.forward(); }
setTimeout("preventBack()", 0);
window.onunload = function () { null };
</script>
This will forward to the last history page.
<script type="text/javascript">
function preventBack() { window.history.forward(); }
setTimeout("preventBack()", 0);
window.onunload = function () { null };
</script>
public class MyPolicy : ICertificatePolicy
{
public bool CheckValidationResult(ServicePoint srvPoint,
X509Certificate certificate, WebRequest request,
int certificateProblem)
{
//Return True to force the certificate to be accepted.
return true;
}
}
protected void Page_Load(object sender, EventArgs e)
{
System.Net.ServicePointManager.CertificatePolicy = new MyPolicy();
// this is CertificatePolicy subclass
try
{
string url = "https://myirl.com";
HttpWebRequest req=(HttpWebRequest)WebRequest.Create(url);
req.KeepAlive = false;
req.AllowAutoRedirect = true;
req.ProtocolVersion = HttpVersion.Version10;
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
byte[] postBytes = Encoding.ASCII.GetBytes("username=sample_post_data");
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = postBytes.Length;
Stream requestStream = req.GetRequestStream();
requestStream.Write(postBytes, 0, postBytes.Length);
requestStream.Close();
HttpWebResponse response = (HttpWebResponse)req.GetResponse();
Stream resStream = response.GetResponseStream();
var sr = new StreamReader(response.GetResponseStream());
string responseText = sr.ReadToEnd();
Response.Write(responseText);
}
catch (Exception ee)
{
}
} }
XmlDocument doc = new XmlDocument(); doc.LoadXml(responseText);Now you can use this xml result according to your requirement.