Hello,
I'm trying to create a similar interface to msnbc.com, where the user can control which pagelets to display, and in what order, and allow the browser to remember the configuration in the future for return visits.
Note, I'm not using actual pagelets here, but div tags that use an ASP FileSystemObject to read the html content of external pages for the "pagelet" content.
So far, I've tried accomplishing this with cookies. When the user first visits the page, I write a default cookie:
Response.Cookies("Pagelets")("1") = pagelet1
Response.Cookies("Pagelets")("2") = pagelet2
For each key in the cookie, I create a div and populate it with the content of the corresponding html page. Each div will have a button to move its position up or down on the page, as well as a button to remove the div from the layout.
To start, I'm working with just the removal process. Right now, the removal button passes a parameter with the cookie key number to the remove_pagelet.asp processing page.
From there, I create an array of all the existing Pagelet cookie keys, excluding the one that is being removed. I then attempt to delete the pagelet cookie with:
Response.Cookies("Pagelets").Expires = Date - 1000
Then, I try to re-create the cookie with the new keys from the array I created, and finally give the cookie a new expiration date with:
Response.Cookies("Pagelets").Expires = Date + 365.
My problem appears to be where I'm attempting to expire the cookie, then recreate it on the same page with a new expiration. It seems to be ignoring the first instance expiration command, and only processing the later instance.
Is there a way to do this?
Basically, I'm going for a portal-like experience, but I'm limited to ASP classic right now. Is there a better way to do this with this programming language?
Thanks,
Dan
I'm trying to create a similar interface to msnbc.com, where the user can control which pagelets to display, and in what order, and allow the browser to remember the configuration in the future for return visits.
Note, I'm not using actual pagelets here, but div tags that use an ASP FileSystemObject to read the html content of external pages for the "pagelet" content.
So far, I've tried accomplishing this with cookies. When the user first visits the page, I write a default cookie:
Response.Cookies("Pagelets")("1") = pagelet1
Response.Cookies("Pagelets")("2") = pagelet2
For each key in the cookie, I create a div and populate it with the content of the corresponding html page. Each div will have a button to move its position up or down on the page, as well as a button to remove the div from the layout.
To start, I'm working with just the removal process. Right now, the removal button passes a parameter with the cookie key number to the remove_pagelet.asp processing page.
From there, I create an array of all the existing Pagelet cookie keys, excluding the one that is being removed. I then attempt to delete the pagelet cookie with:
Response.Cookies("Pagelets").Expires = Date - 1000
Then, I try to re-create the cookie with the new keys from the array I created, and finally give the cookie a new expiration date with:
Response.Cookies("Pagelets").Expires = Date + 365.
My problem appears to be where I'm attempting to expire the cookie, then recreate it on the same page with a new expiration. It seems to be ignoring the first instance expiration command, and only processing the later instance.
Is there a way to do this?
Basically, I'm going for a portal-like experience, but I'm limited to ASP classic right now. Is there a better way to do this with this programming language?
Thanks,
Dan