RTUR.NET

.NET and Open Source: better together

NAVIGATION - SEARCH

Dynamic compilation in ASP.NET

We all know about magic App_Code folder. Just drop class file in there and it will become a part of the web application. This is fine for scripts like PHP or "classic" ASP (VB script), but C# is strongly typed compiled language. How App_Code works? As any magic, mostly smoke and mirrors. Behind the scene, ASP.NET will create App_Code.dll and merge it with main application assembly at run time. This simple trick gives us best of both worlds - dynamism of scripting languages (ok, to the point) and all the good stuff coming with strong typing and compilation (whatever they are). More...

Serializing XMLDocument to binary format

Why in the world would you want to do that? Well, for one, you might want to use it in Remoting. Second possibility is when you have different objects that you want to treat the same way, and XML Document is one of them. Whatever your situation is, XML Document is not serializable as is. You'll have to provide your own implementation - create class that inherits from XMLDocument and implements ISerializable interface: More...

Sorted GridView

Did it ever happened to you? You have a problem and, after research and brainstorming, finally come up with this nice elegant solution. Two month (and hundred problems) later, you are staring at the screen with basically the same task in front of you. And trying to figure out - how the hell did you do it in the first place? Yes, I'm talking knowledge base - not an original idea and lots of people use their blogs exactly for this reason. I'm joining the crowd and will publish here code snippets under "code snippets" category. Here is the first one. More...