help.net
<font size="2"><br />Musing on .Net</font>
-
Default button
I was looking for a solution to this issue:
How to assign a button to the Enter key ?
Well thanks to usergroup list, this one come very handy.
http://www.metabuilders.com/Tools/DefaultButtons.aspx -
Cookies... Eat me
Response.Cookies("MyCookie").Expires = DateTime.Now.AddDays(-30)
Great, it works but not immediatly. So I suggest that you write again the cookie with empty values to really empty the cookie before it disappear.
I had to do that because the clipboard function I use is a panel visible or not.
So if I delete the cookie, and the user make visible the clipboard very quickly, the cookies values are still there. Emptied it solved the problem, well for me. -
Mmmm ... Cookies
To be honest, I didn't used really cookies on a project since a very long time, but in Scoilnet, the education portal I am building for the Irish government,
here we go, I need it.
I had to implement a neat feature to let users, mostly teachers, keeping in a 'clipboard' some resources(HTML documents) for a certain period of time.
And indeed retrieve the content of their clipboard when they need it, today or in 10 days. Add to these requirements that they don't login to access the site, and., correct me if I am wrong, cookies ready to cook !
I remember vaguely that cookies implementation before was a piece of cake (sorry I couldn't missed this one;-)), so because .Net rocks, it would be easy.
Not so easy, indeed. It took me few hours to figure out how to make this working properly.
I discovered that when you write some values to a cookie, you need to check if the cookie exist to avoid an exception error.
Great, but when you write something like if request.cookies("Mycookie") is nothing then... you enter in a mysterious world.
To be more explicit, you have with .Net 2 types of cookies, the session one, and the persistent one. The first disappear when the user do the same, and the second stay on the user disk. The difference is just a tiny property Expires. If you pass to this an expiration date, it's persistent, otherwise not.
The problem, is when you do a test to check that the cookie is there, .Net for a reason which elude me, create the cookie, but with a null expiration date.
Yes you just guessed it, it's a session cookie. And now everything you can write in your cookie after that are not written to the disk, believe me I spend sometime to discover this.
In some scenario, it could be worse, if you use a watch in VS.Net, you create again this fugitive cookie.
The incoming (Request) cookie carries an Expires date of DateTime.MinValue, regardless of the date attached to the cookie on the client system.
Read this clever article on CodeProject to know more about this problem and a solution.
So my little solution is this one, I admit unclean, but unfortunatly not too much time. I am sure someone has a better explanation, but cookies and .Net are not the best ingredients for a good recipe. -
GeoBlog
Hey Christophe, this Geoblog stuff is pretty cool.
I just wonder what's going to happen in case of success. It could be a little bit messy all this blogs popup from everywhere.
But it's really a feature to learn about the real world linked to the superficial world of Internet !
I like this idea of global Cafe du Commerce, with everybody talking about everything. -
En attendant Bill
Julie replied to my comment on Bill blog:
So Paschal. If you refer to Bill Gates as God, then who are you referring to here as Jesus?
Nice one Julie. Of course I can say Scott for opening our can of blogs, but it was more something like Jeez ! -
Apple enter the music business
-
Web deployment
My project Scoilnet start now to be big, and I am confronted now with deployment issues.
I setup the firewall to let only port 80 connections accepted, so obviously I can't use any FTP upload.
I would like now to deploy only certain files and not as I am doing now, all the project.
I found the deployment with VS very handy, but is it possible to copy only certain files ?
I know already I can exclude from my project the files I don't want to copy, but now that seems impossible regarding the size of the solution.
Any idea about an add-in to do that ? -
En attendant Bill
-
wbloggar
Roy, to write your blogs which one you prefer , this one or this one ;-))
-
Imagine Cup 2
Ok, now onto my second day at Microsoft. BTW, this was on Saturday. This was the day of the US Finals judging for the Imagine Cup 2003.