Mehmet ÇATKIN personal weblog

herşey çooooook .NET

Static Singletons for ASP.NET Controls

clock Temmuz 13, 2008 04:00 by author mehmetcatkin
When building generic ASP.NET Server controls that also provide a sort of API service to other custom controls or page level code, it's often necessary to ensure that only a single instance of a control exists, and that only that single instance of this control or component can be accessed in the context of an ASP.NET request. While this is usually easy to accomplish in actual page code (since you can reference the control or component explicitly), if the API is also consumed by other Server Controls it's crucial that it's easy and efficient to find and access that single instance of a control effectively. This isn't a typical scenario, but it's a common pattern for controls that expose API level functionality in addition to the actual control based markup.. [More]

Currently rated 5.0 by 2 people

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


Dynamic Queries and LINQ Expressions

clock Temmuz 11, 2008 11:37 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 2 people

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


VS 2008 and .NET Framework 3.5 SP 1(BETA) Released

clock Temmuz 10, 2008 18:52 by author mehmetcatkin
Scott has published a post about SP 1 beta for VS 2008 and .NET Framework 3.5. You can read the post here and you can download the sp 1 beta here.. [More]

Currently rated 5.0 by 2 people

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


GoDaddy and SocketPermissions

clock Temmuz 9, 2008 21:20 by author mehmetcatkin
o I just got off the phone with support at GoDaddy for one of my customers and was told "Sorry we can't do that", when asked to provide socket permissions to go out and hit a POP3 server. GoDaddy has the web.config locked down and so you can't override the originUrl="site" so my customer is dead in the water with this account.. [More]

Currently rated 5.0 by 1 people

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


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


Search

Tags

Advertisement

Categories


Calendar

<<  Kasım 2008  >>
PaPaSaÇaPeCuCu
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

Archive

Authors

Blogroll

Recent comments

Copyright

© Copyright 2008 Mehmet ÇATKIN

Sign in