Browse by Tags

All Tags » .NET (RSS)
I recently ran into a neat little nugget of functionality in C# with events. Normally in C# when we define events we stop at something like this: public event EventHandler<MyEventArgs> MyEvent; The thing is, you can explicitly implement the add...
Posted by Christopher | 1 comment(s)
Filed under:
This is just a re-statement of a forum thread that discusses the fix, but since gotdotnet is not going to be around very much longer I thought I'd post this little tidbit here as well. Basically, when I upgraded one of my sites to .net 2.0, skmMenu got...
I read this excellent post from ScottGu and decided to use it with a page that implemented a masterpage. I didn't have to use postbacks in my scenario, but there were links included from the masterpage. The problem is that if you use app-relative paths...
Posted by Christopher | 2 comment(s)
Filed under:
So I've been able to dig my teeth into some asp.net hacking recently, and I've been wrestling with learning to use SubSonic in the process. In dealing with the scaffold control I ran into a funny issue: none of the exposed properties on the scaffold control...
Posted by Christopher | 1 comment(s)
Filed under: ,
Exactly what I was looking for ...I don't know a lot about reflection, so I wonder if there is a more elegant way to get this info.
Posted by Christopher | 2 comment(s)
Filed under:
There are a few things that have to happen for this "regression" to show up. First, you have to be working in .net 2.0 WinForms. Second, you must be using a custom application context. Third and most importantly, you must have at least one form open in...
Posted by Christopher | 2 comment(s)
Filed under: ,
Wow.
Posted by Christopher | with no comments
Filed under:
Jerry Pisk Path.GetTempFileName() guarantees that you will get an available name, it does actually go ahead and create the file so it is guaranteed to be yours when you use it. If you strip the extension off and substitute your own you may end up overwriting...
Posted by Christopher | 8 comment(s)
Filed under:
If you need to generate temporary / semi-unique filenames, here is a little snippet that uses the framework: using System.IO; string GetTempFileName(){ return Path.GetFileNameWithoutExtension(Path.GetTempFileName()); } As the name implies, this will return...
Posted by Christopher | 6 comment(s)
Filed under:
Using Yield in Practice The moral of the story is STOP thinking so hard about it , just use "yield return" the next piece of data in the list. When using the yield statment GetEnumerator's job is to answer foreach's question - "what's my next item please...
Posted by Christopher | with no comments
Filed under:
More Posts Next page »