Hi,
I am trying to post some information as context item to another web page but not able to retrieve the value of context items on the page load of the page receiving the request. Both the websites are in different domains.
Can someone tell me how can i achieve this?
I have the HTTPWebRequest created as below:
Below is code snippet on the page to read back the context item.
I am trying to post some information as context item to another web page but not able to retrieve the value of context items on the page load of the page receiving the request. Both the websites are in different domains.
Can someone tell me how can i achieve this?
I have the HTTPWebRequest created as below:
Code:
WebRequest postDataWebRequest = WebRequest.Create(searchUrl);
HttpWebRequest postDataHttpRequest = (HttpWebRequest)postDataWebRequest;
postDataHttpRequest.ContentType = "text/plain";
postDataHttpRequest.KeepAlive = true;
postDataHttpRequest.Method = "POST";
this.Context.Items.Add("testkey", txtUsrName.Text);
HttpWebResponse searchResultResponse = (HttpWebResponse)postDataHttpRequest.GetResponse();
Code:
protected void Page_Load(object sender, EventArgs e)
{
string test;
test = this.Context.Items["testkey"].ToString(); // ---> exception thrown here.
Response.Write(test);
}