Mehmet ÇATKIN personal weblog

herşey çooooook .NET

Odd string.Replace Chaining Behavior

clock Haziran 11, 2008 18:46 by author mehmetcatkin
I ran into a bit of a head scratcher today with a routine that does some string manipulation. It's an old routine that I use to help me do the equivalent of ResolveUrl() outside of the context of the ASP.NET Page framework - typically in static code somewhere or as part of a handler or other component. The process is easy enough but I ran into a snag with the special case of resolving a root web path (ie. /wwbanner.ashx for example) and the routine has some admittedly hacky code that checks for the possibility of duplicated slashes in the front. So basically there's some code that looks like this:. [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


XmlWriter and Schema

clock Haziran 10, 2008 22:07 by author mehmetcatkin
In the ResX exporter for my data driven Resource Provider I use a bit of code that iterates over the database resources and then spits out ResX resources from the data as an option to get your resources into your Web site. The code I've used in this stretch of code uses an XmlWriter to quickly spit out the data. But there are a couple of non-critical problems in that code. Several people have pointed out that the XML generated doesn't exactly match the ResX format that Visual Studio uses (although as far as I can tell there's no problem). The problem is related to an xml:space="preserve" attribute that Visual Studio sticks onto each resource. It does this so leading and trailing spaces are preserved when the values are read. Visual Studio generates:. [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Rendering a WPF Container to Bitmap

clock Haziran 8, 2008 13:30 by author mehmetcatkin
I'm playing around a little today with WPF again. One thing I like about WPF is the fact that you can take just about anything that you render on the canvas and dump it out as a bitmap file. Since it's fairly easy to create images and shapes in WPF I thought I'd create a quick form to created rounded corner bars, because one can never have enogh of those in Web applications ... Oh ok, so I have tools that do that shit, but I wanted to see what it takes to do this with WPF. A few hours later I got it working, but there were a few hiccups along the way. Here's what the end result looks like:. [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Byte Order Marks and XmlDocument Streaming to HTTP

clock Haziran 7, 2008 20:46 by author mehmetcatkin
Argh. I just got bit again by Byte Order marks that get sent out over HTTP when using ASP.NET. Basically the problem is that .NET's default XmlTextWriter encoding uses UTF-8 and the default Encoding includes generation of a BOM as part of the output. If that output gets sent to the Response output the BOM gets sent along with it which is definitely what you want. In case you don't know what a BOM is - it's the the preamble that gets attached to the beginning of the document to identify its Encoding. There are different preambles for different Encodings. It's meant for files stored on disk so that when a file is opened there's a quick way for an editor to detect the encoding for the file. If you look at a UTF-8 document with a hex editor (or any editor that doesn't apply any encoding) you'd see:. [More]

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Unwanted Padding in IE Image Rendering in div Tag

clock Haziran 6, 2008 16:53 by author mehmetcatkin
Here's another annoying IE rendering issue: When rendering images inside of a div tag, if the image is just a single image the div or image will somehow throw in a few pixels of padding. Using standard XHTML 1.0 DocType the following markup generates a slight border between the. [More]

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Dynamic Queries and LINQ Expressions

clock Haziran 4, 2008 22:23 by author mehmetcatkin
I'm revisiting some code in my LINQ to SQL business objects layer that I've written about before. The problem I ran into and described was that I had a class with generic business object behavior that needs to look up values based on a database field that wouldn't be known until runtime. The concrete example I used is a Load(object x) method on the business object, where each instance of the class dynamically picks up the primary key (from the metadata available) and then loads an entity from the database through LINQ.. [More]

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Non ASPX Extensions and Authentication in the IIS 7 Integrated Pipeline

clock Haziran 3, 2008 10:34 by author mehmetcatkin
Last week, I ran into an interesting problem that I didn't immediately find a solution for. I was cleaning up one of my DevConnections samples, which is a photo album application. The idea is that any folder that contains images, multi-media content or anything else can be turned into a dynamic photoalbum by copying a couple of files into this folder that can then be accessed from the Web. What I needed to do is have a dynamic URL that when executed in this directory automatically creates the photo album related files in the current folder.. [More]

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Search

Tags

Advertisement

Categories


Calendar

<<  Ocak 2009  >>
PaPaSaÇaPeCuCu
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

Archive

Authors

Blogroll

Recent comments

Copyright

© Copyright 2009 Mehmet ÇATKIN

Sign in