How do I persist the value of a label through a response.redirect?

Posted by Divs99 under C# on 8/23/2012 | Points: 10 | Views : 1885 | Status : [Member] | Replies : 4
How do I persist the value of a label through a response.redirect?

i reid by viewstate and hidden field...getting blank in postback becoz of response.redirect.........pls help me out.......

how to do cross page technique.....is there any other way to do hold the value of a label through response.redirect...




Responses

Posted by: Rambabu123 on: 8/23/2012 [Member] Starter | Points: 25

Up
0
Down
Label lbl=new Label();
Response.Redirect("~/pageurl.aspx?Lblvalue=" + lbl.Text);//here passing to the value

//here getting to the value
string str= Request.QueryString["Lblvalue"].ToString();

i think it is usefull for u

Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Divs99 on: 8/23/2012 [Member] Starter | Points: 25

Up
0
Down
i dont want by passing query string..........becoz In label iam getting date and time stamp ...if i pass to tht url..then it will be probs....

Previous page property is it works for response.redirect?

Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Johnbhatt on: 8/24/2012 [Member] Starter | Points: 25

Up
0
Down
Use Cookies.

First Create a Cookie and Add Value of Label.
Then just retrieve value of Cookie and Print when needed.

Detailed Instruction is here:

http://www.dotnetfunda.com/codes/code2760-creating-cookie-and-using-cookie.aspx

John Bhatt
Glad to Know, Free to Share.....
http://www.johnbhatt.com

Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Shanky11 on: 8/27/2012 [Member] Starter | Points: 25

Up
0
Down
Response.Redirect("~/pageurl.aspx?Lblvalue=" + lbl.Text);
Lblvalue is label name or something else


Divs99, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response