S
Spongebob
Hello, I have a question about how to pass information between pages in
ASP.NET. There are 2 pages : page1.aspx, page2.aspx.
On page1 user clicks the record. Then, I need to show the detailed info
about that record in page2. How to pass the ID of record? Should I use
querystring or cookies or session variable?
The problem is:
1. I don't want to use query string at all :^(
2. There is no need to create the cookie or session variable for a
certain time, I only want to pass the int number from page1 to page2. :^(
3. It seems to me that the best way to solve that is to pass number via
page header. I use this sintax: :^(
in page1:
Response.AppendHeader("recordID","123");
Response.Redirect("page2.aspx");
in page2 on page load event:
Label1.Text=Request.Headers["recordID"].ToString(); //oh... :=(
But that doesn't work. May be wrong caching parameters? I've tried to set
Response.Cache.SetCacheability(HttpCacheability.NoCache), but that didn't
work too.
4. I think other suggested methods are too resource-expensive, why don't
use headers?
Oh, could somebody please explain me how to solve the situation?
Thanks a lot for Your attention and reading my message :^)
Andriy
ASP.NET. There are 2 pages : page1.aspx, page2.aspx.
On page1 user clicks the record. Then, I need to show the detailed info
about that record in page2. How to pass the ID of record? Should I use
querystring or cookies or session variable?
The problem is:
1. I don't want to use query string at all :^(
2. There is no need to create the cookie or session variable for a
certain time, I only want to pass the int number from page1 to page2. :^(
3. It seems to me that the best way to solve that is to pass number via
page header. I use this sintax: :^(
in page1:
Response.AppendHeader("recordID","123");
Response.Redirect("page2.aspx");
in page2 on page load event:
Label1.Text=Request.Headers["recordID"].ToString(); //oh... :=(
But that doesn't work. May be wrong caching parameters? I've tried to set
Response.Cache.SetCacheability(HttpCacheability.NoCache), but that didn't
work too.
4. I think other suggested methods are too resource-expensive, why don't
use headers?
Oh, could somebody please explain me how to solve the situation?
Thanks a lot for Your attention and reading my message :^)
Andriy