Geeks With Blogs
Adrian Hara Working through the .NET maze May 2006 Entries
App_Data cannot contain images
Until today I didn't know that the App_Data folder cannot contain images. Well, actually it can, it's just that the images won't be served, for security reasons. Normally I wouldn't put my images in the App_Data folder but rather in a Images folder beneath the root, but I was just testing something today and trying to add an image to a treeview node i put it in the App_Data foder just because the folder was already there. And then I spent the next 10 minutes trying to figure out why the image wouldn't ......

Posted On Wednesday, May 24, 2006 8:30 AM

XmlWriter's Close bug
I've looked around on the net but didn't find anything about what seems like a bug in XmlWriter to me. The thing is, in .net 2.0, instead of doing a new XmlWriter(), there is now a static XmlWriter.Create method, with a number of overloads. That stated, can you spot anything wrong with this code: XmlWriter writer = XmlWriter.Create(new FileStream("test.xml", FileMode.Create)); // do some stuff writer.Close(); I didn't, but as it turns out, this does not close the FileStream used by the XmlWriter. ......

Posted On Tuesday, May 16, 2006 2:20 PM

Global Resources weirdness
A colleague of mine asked me today if there is a better way to set the CurrentUICulture in 2.0 than handling Application_BeginRequest and doing Thread.CurrentUICulture = new CultureInfo(foo). He asked me this because he was doing something like CommonStrings.Culture = new CultureInfo(whatever), where CommonStrings is a .resx file residing in our App_GlobalResources folder. As you might know, 2.0 generates a wrapper class around string resources for strongly typed access, so instead ......

Posted On Tuesday, May 9, 2006 1:25 PM

Themes + base != love
In the current project I'm working on, we have to have an “export to pdf” functionality for each page. So we've been using webSupergoo's ABCPDF successfully until yesterday, when I found that we could change the way we're inserting the css stylesheet into the pages for the better. We used to do this: <link rel="stylesheet" href="<%= ResolveUrl(AppConfigurator.... %> " type="text/css"> ...where AppConfigurator is a static class holding a reference to a static NameValueCollection, ......

Posted On Friday, May 5, 2006 11:52 AM

Cookieless Forms Authentication and Redirection
Here's one that had me scratching my head for a bit.As you might know, in 2.0 you can choose to have cookieless Forms Authentication ( Basically, what this means is that your pages Url's will get increased by about 200% :) because no longer stores the forms authentication information in a cookie, but directly in the Url. Also, you can have cookieless session state, meaning some extra characters get added again in the ......

Posted On Tuesday, May 2, 2006 1:16 PM

Hello World
Hello fellow bloggers, Yea...umm... this sets out to be a blog where i'd like to jot down various problems and oddities (at least for me) that i run into through my .net developer life. Hopefully i won't be excessively boring and bring some interesting stuff to the table. Also, i want to ask for your forgiveness if my English is poor (not a native speaker) or the subjects seem trivial. Basically, i'd like this to be a place that helps me refresh my short (rodent :)) memory so i don't have to solve ......

Posted On Tuesday, May 2, 2006 1:03 PM

Copyright © Adrian Hara | Powered by: