Entries Tagged 'Tech/C# and ASP.NET' ↓
April 18th, 2008 — Tech/C# and ASP.NET
We just finished moving a few apps from .Net Framework 1.1 to 3.5. One of the problems we ran into was this exception when using some symmetric encryption code. When we decrypted the value from the DB, this was being thrown.
From what I can tell, it looks like in 1.1 passing null data to the decryption worked (or at least silently failed) and likely returned null back (well, a blank string in our case due to type conversion). However, in 3.5 this exception gets thrown.
An easy fix but one of those little things that took a while to track down so hope this helps someone.
August 24th, 2004 — Tech/C# and ASP.NET
You would think of all the nice features they have in .Net that parsing comand line parameters to a console app would be as easy as calling a property. You would be wrong. C'mon, how hard would it have been to have Environment.GetCommandLineArgsByName(string argname) ?
I don't think in zero-based arrays so I didn't want to be tied to using Environment.GetCommandLineArgs. I looked for other ways to do it and ran across a post on the NUnitAddin blog about using an XmlSerializer to parse them. Cool. Very cool. Very little code and it makes sense (even before you understand it completely).
June 28th, 2004 — Tech/C# and ASP.NET
Big thanks to the folks that developed OpenSmtp.net and made it available under the LGPL. I just ripped out Persits AspEmail from an ASP.NET project and replaced it with OpenSmtp.net. I never liked using AspEmail in .net since it wasn't native .net and very fickle.
March 12th, 2004 — Tech/C# and ASP.NET
Probably not. For future reference: “0:d” for a short date. Maybe I need to print out a good reference when I find one.
February 28th, 2004 — Tech/C# and ASP.NET
I've been doing some PHP development for a new site for my company. I can't tell you about it since it is classified “super f'ing secret”–actually it is just a cheesy parking page and I don't want any search engines spidering it until there is some real content. But, back to something resembling the title of this article. When ASP.NET first came out, I jumped on the bandwagon faster than you can say OOP. For the most part, I have no regrets. Classic ASP seems so two years ago and doing maintenance on old code usually brings a combination of laughter and crying which ends with a beer.
PHP is bringing back some of these feelings since it is a scripting language. In some ways, this is great: no compiling, no xcopy distribution (great term, I guess FTP wasn't M$-centric enough), and no IIS. However, it still *feels* like I'm taking a step back. OK, half a step since PHP is really cool in that it has some great features: templates, OO, functions out the wazoo, and the all-important recursive acronym name.
Regardless, the more I use it, the more I like it. Now, if only I could call my .Net compiled DLLs from PHP…
February 14th, 2004 — Tech/C# and ASP.NET
Good tips for using DateTime in .Net on MSDN
January 14th, 2004 — Tech/C# and ASP.NET
Since I'm used to PCRE when building regular expressions, this is a nice tool to use to be able to evaluate .Net regular expression strings before implementing them in code.
January 7th, 2004 — Tech/C# and ASP.NET
Fabrice's weblog gave me the quick and easy answer to how to do this. The only problem I ran into was that VS.NET (at least 2002) removes the runat="server" attribute from the title tag when you switch from HTML to design view.
January 4th, 2004 — Tech/C# and ASP.NET
I love ASP.NET for web programming. I especially like being able to create classes and use them in the code-behind for a page. The problem I was running into is that I found I needed to access some page-specific properties like Server, Session, Request, Repsonse, etc inside a class. My first inclination was to inherit the System.Web.Page class. This worked but seemed like overkill–there had to be a better way.
A while back, I came across System.Web.HttpContext. This class has a property name Current which basically wires you in to the current HttpContext your code is running in. From there it is easy to get access to Session state, Request variables, etc.
For example, to get the value of a session variable, just use System.Web.HttpContext.Current.Session["variable"] where “variable” is the variable who's value you want.
I figured I'd mention this since I don't recall seeing much on it in the books on ASP.NET I've read or articles I've seen.
December 15th, 2003 — Tech/C# and ASP.NET
Thanks to Matt Berther for his post regarding why the enter key wasn't working to submit an ASP.NET form (using IE, not a browser where enter normally won't submit the form w/out JavaScript).
As Matt notes, the solution is to “Add this line somewhere on the page: , and all will work as expected.”