by ira
4. May 2009 19:13
In April of '08, I wrote a post about cleaning up the ASP.NET head tag using control adapters. I've got some great feedback from it, and I'm glad that I'm not the only one that is horrified when looking at the source of an ASP.NET rendered web page. From the comments of that article I was recently asked how to clean up JavaScript tags. With the code from the project download of the article as-is, when I just slap some script tags in the head tag I get something that looks like this rendered: However, so...
[More]
by ira
27. April 2009 18:33
So you may have found yourself in a similar situation, needing to make a TCP/IP request to a 3rd party API possibly using SSL. Well, that is a quite simple task. It can however, be complicated if this 3rd party requires the use of certificates for communication to its API server. I found myself in some sort of certificate hell where I had the certificate, added it to the request and somehow it still wasn't working. If you know what I'm talking about and had as many hurdles as I did, my condolences to you. I...
[More]
by Ira
8. October 2008 20:33
If you look up accessibility levels on the MSDN web site, it will tell you that the accessibility of the private access modifier is limited to the containing type. I ran into an instance that showed me the direct meaning of this statement. The scenario I had was this: I wanted to have the ability to make an object read only. That is the original object however, if a clone was made then the object could be modified again because it wasn't the original object. Of course this is a simple task, we get to go bac...
[More]
by Ira
26. August 2008 17:58
In a recent situation I was trying to pull some aggregates out of a DataTable using LINQ. I needed to get the rows of the DataTable with a Distinct clause, but my aggregates would be on other columns of the row. The problem is that when you call LINQ's Distinct() extension method with no arguments, it uses the "default IEqualityComparer". This means that it will work if you use the Select() extension method, only returning the column you want the distinct on. Well that works great, unless yo...
[More]
9eddbcd7-7533-4d6b-abb7-b316e3077e5b|1|4.0
Tags: c#, linq
C# | LINQ
by Ira
3. June 2008 17:53
A short time ago I was confronted with a serious problem. What I needed to do was dynamically choose a UserControl as well as fire methods from that UserControl. The problem lies in the fact that a UserControl does not implement my custom methods that I needed for my controls. Each control was similar and would have the same methods but it would have different display characteristics. That was when I had a small epiphany. Why can't I just make an abstract base class? Well the answer is you can! Som...
[More]
by Ira
21. April 2008 17:47
If you haven't tried using the event model in .NET you don't know what you're missing. If this is the case, then I'm glad you're here. Events are a very nice way to add flexibility to your projects. You can use them for a variety of things including validation and logging. You can think of an event as sort of an All Points Bulletin (APB) throughout your application. Once you declare and throw an event, every place in your code that has an event handler for that event wil...
[More]
by Ira
14. April 2008 18:39
Ok, if you're anything like me you absolutely gag when you see the rendered content of the ASP.NET head tag. It is all rendered out inline for some reason. I'm not 100% sure about the affects of it on web marketing, but I know one thing is for sure... It certainly doesn't help your rankings any. At the very least it looks gross and it can be easily fixed with some portable c# files that you can include in any project. I found a reference here about it, so I picked it up and ran with it.
...
[More]
by Ira
27. March 2008 20:26
So I was stuck in a scenario where I needed to have multiple DetailsViews run an update command at the same time. I thought through it in my head saying to myself, "How do I click two update buttons at once?". Wouldn't it be nice if I could have a single button click event and have both DetailsView controls update at the same time? I tried simply calling the .Update() method of the ObjectDataSouce controls they were bound to and it didn't work. So I had one last thought, wouldn't it ...
[More]
by Ira
23. March 2008 19:08
Ok, I ran into a major problem not so long ago. This problem stemmed from a DataObject that had a child object within it, here in referred to as a "complex object". When I put an ObjectDataSource on my page and bound to my business layer with my complex DataObject, for some reason only the simple properties would show up. Simple properties being those that are passed by value and of a .NET system type. My custom typed property never shows up in my data bound control. Hmmmmm...
...
[More]
by Ira
13. March 2008 18:37
Lately, I have been having to deal with finding ASP.NET Ajax when creating server controls. It is actually quite simple to do, and I think that if you are going to be coding server controls for ASP.NET you should definitely know how to do it. So in this post, we will go through embedding a javascript file into your assembly and then registering it to the page. Then I will show you how to find out if ASP.NET Ajax is loaded during the script registration and also how to find out if ASP.NET Ajax is loaded in...
[More]