J
jmensch
Hello. I'm a reasonably new ASP.NET programmer
with no prior ASP or web development experience,
but a lot of general programming experience. I'm
using Visual Web Developer Beta Express 2005.
I'm trying to find a way to store data in the
URL of my pages. I know that SessionState does
this if you go cookieless, and that's useful but
it's not what I want because the real data is
stored on the server, and only an ID code is
stored in the URL.
What I'm doing is implementing a database search
that displays results in a manner similar to
Google, such that 32 results will be displayed on
four pages, with 10 results per page. Of course,
there's only one actual "search results" page and
the virtual page the user is on is stored in a
variable, Session("ResultsPage"). When the user
presses the LinkButton to take them to the next
page of results, what actually happens is that the
variable is incremented by one, the same page is
reposted and the Page_Load function fills an
HttpPlaceholder Control with the next set of
results.
Now, this all works excelently... until you take
into account the browser's back button. When the
user has gone from the Search page to Results Page 1,
then Results Page 2, pressing Back should take them
back to Results Page 1, but of course it doesn't,
since 1 and 2 are really the same page reposted
differently due to data in a cookie.
Since a browser's history is based on URLs, you
clearly want to store the ResultsPage variable in
the URL itself, so that Back works properly. If you
look at the URLs Google uses when you search, you
can see that it does exactly this.
So anyway, my question is how you achieve this
URL-mangling in ASP.NET. I've read through every
description of the HttpSessionState class that I
can find, and I can't find any referance to URL-
variables in a non-cookieless session.
If someone could tell me where in the Framework
this functionality could be found, I'd greatly
appreuciate it. I just need the procedure calls
and class names that are used; I can learn the
rest easily myself.
Thanks for your time and interest,
-- Julian Mensch
with no prior ASP or web development experience,
but a lot of general programming experience. I'm
using Visual Web Developer Beta Express 2005.
I'm trying to find a way to store data in the
URL of my pages. I know that SessionState does
this if you go cookieless, and that's useful but
it's not what I want because the real data is
stored on the server, and only an ID code is
stored in the URL.
What I'm doing is implementing a database search
that displays results in a manner similar to
Google, such that 32 results will be displayed on
four pages, with 10 results per page. Of course,
there's only one actual "search results" page and
the virtual page the user is on is stored in a
variable, Session("ResultsPage"). When the user
presses the LinkButton to take them to the next
page of results, what actually happens is that the
variable is incremented by one, the same page is
reposted and the Page_Load function fills an
HttpPlaceholder Control with the next set of
results.
Now, this all works excelently... until you take
into account the browser's back button. When the
user has gone from the Search page to Results Page 1,
then Results Page 2, pressing Back should take them
back to Results Page 1, but of course it doesn't,
since 1 and 2 are really the same page reposted
differently due to data in a cookie.
Since a browser's history is based on URLs, you
clearly want to store the ResultsPage variable in
the URL itself, so that Back works properly. If you
look at the URLs Google uses when you search, you
can see that it does exactly this.
So anyway, my question is how you achieve this
URL-mangling in ASP.NET. I've read through every
description of the HttpSessionState class that I
can find, and I can't find any referance to URL-
variables in a non-cookieless session.
If someone could tell me where in the Framework
this functionality could be found, I'd greatly
appreuciate it. I just need the procedure calls
and class names that are used; I can learn the
rest easily myself.
Thanks for your time and interest,
-- Julian Mensch