| Subcribe via RSS

Find All Cookie Values in a Given Application via ASP.Net and c#

January 14th, 2010 | Comments Off | Posted in ASP.NET, C#

Cookies can be especially maddening at times if you don’t know what values are being stored within them. The following simple script is written in csharp and ASP.Net and allows you to see all of the cookies currently hanging around under a given application. Pretty handy when trying to fish yourself out of a problem.

Error Message: Could not find file ‘c:\windows\system32\inetsrv\System.Xml.XmlDocument’.

January 13th, 2010 | Comments Off | Posted in XML

Someday I’ll free myself from the XML hell I seem to be mired in, but that day is not today. So I’ve got a fun new issue. The previous coder stored all the user entry values in session values without thinking about the fact that this won’t run correctly once it goes live in the web farm. So now I have to switch all those values over to be stored in the cookie and a few in the database that need to be secured. So in my haste to switch everything over, I ran across the error message “Could not find file ‘c:\windows\system32\inetsrv\System.Xml.XmlDocument’.” Huh? All I’ve done is try to store the Xml string into a XmlDocument object like so:

After pondering and tinkering with this for the better part of 30 minutes, it finally occured to me. The Load method of XmlDocument is used to access an Xml file on the server whereas the LoadXml method is used to load a previously defined Xml string. Popped that in, and it worked like a charm. Now what is my next error?

Google US Search Listings Versus Google Canada

January 5th, 2010 | Comments Off | Posted in SEO
I was reviewing my traffic logs this afternoon and I noticed a couple of my sites have risen up the ranks to number 3 on their key respective search term on Google — Canada? Hmmm…when I look at the main Google US site the websites in question are ranking 8 and 11. Not bad mind you, but why would Google Canada think so much more highly of these domains than its US counterpart when they are hosted in the US and there is nothing Canada specific about them (they are pretty generic and all country friendly actually)? Google’s search algorithm is the ultimate black box so who knows for sure, but I did run across this interesting article breaking down what could be influencing its decision at NVI Solutions. Check it out.

Navigating to a Sibling Node via XPath

January 4th, 2010 | Comments Off | Posted in XSL

So I’m in an XSLT stylesheet, and I’ve navigated my way down to the node level. Now I’m trying to traverse my way down to the next sibling node and get an attribute out of it. Something like the following:

Not the best XML structure in the world, but what do you do when you have inherited code? After a long time of searching and trying out about 20 different possible iterations, I found the best solution to be:

For a quick translation, we are currently at the question node from the XML sample above, looking to step down into the answer node to get the text value. The second XSLT code block’s select statement tells the routine to get the following sibling node ‘answer’ even more specifically the first answer node following the question node. From there, we just reference the text attribute within the node.