Hello, I'm Jason
I live with my family in the rolling hills of Northeastern Pennsylvania. I'm a web developer by trade, but have broad experience in various business areas. Want to know more about me?
How To: Validate HTML Email Content For Outlook 2007
Quite often, we send out automated emails from our .NET applications. Usually they are for our own internal users, but from time to time, they are for external users. Outlook 2007 and Word 2007 revamped the HTML Email rendering. They now use the Word 2007 Schema, a subset of the 4.01 Transitional Schema. Apparently, Word 2007 doesn’t like certain CSS attributes especially if you use normal CSS to layout your email (fixed width divs, etc). More information about this topic can be found by visiting http://msdn2.microsoft.com/en-us/library/aa338200.aspx and http://msdn2.microsoft.com/en-us/library/aa338201.aspx. Microsoft offers a few options to validate your HTML, CSS, XML, etc with the Word 2007 Schema. Using the two links above, you can find all of the aforementioned information.
Read MoreLightbulb: How to add a Custom Class to ViewState
I was building a page today that allows an admin to do some configuration and doesn’t save anything back to the server until the admin chooses. I could have used XML or a temporary SQL table, but I choose ViewState for now. I continually received the error: Type 'MyNamespace.MyClass' in Assembly 'App_Code.gvg30s8w, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
is not marked as serializable. Of course the error spells out what’s wrong. But, because I was still flustered with my earlier issue, I didn’t read into it far enough. Again, a search online turns up almost nothing. Finally, the light came on. To get it to work you will need to add the <Serializable>
(in VB) or [serializable]
(in C# to the beginning of your class. Well, back to the grind.
Lightbulb: How To Access the Item's Index in a DataList or Repeater
Like every other day, I’m blowing through some really complex code trying to create hacks to get around difficult issues. Then, a road block. I have a mind freeze and oops, I forgot what the issue is. I had that earlier today when I forgot how to access the item index number in an ItemTemplate
of a DataList
or Repeater
. I pinged the aspadvice.com lists and Ryan Trudelle-Schwarz responded (although he forgot the big Duh! on the top) to use the Container.ItemIndex
. Low and behold, adding this: <%# Container.ItemIndex %>
to your code does spit out the Item Index number. After a good hour or so of searching MSDN trying to find it, Ryan came to the rescue. Thanks again Ryan for kick starting my brain.
Using Older AJAX Controls in Visual Studio 2008
I’ve been testing the DotNetSlackers’ AJAX Data Controls for a little bit and they’re definitely cool. I ran into an issue, however, when trying to build an app with one of the controls in Visual Studio 2008 (.NET Framework 3.5). The assembly was compiled against version 1 of the AJAX Library. I continually received an error message stating The control with ID 'TestGrid' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
However, it did have a ScriptManager
before the TestGrid
control. I bounced it off the Microsoft ASP.NET team and, like always, they provided me with an answer. Mike Harder said that if the assembly was compiled against the earlier version, I needed to redirect the binding at runtime using this:
VS2008 VPCs Expiring 11/1 - Backup Your Data Now
I just read a post stating that the Visual Studio 2008 VPCs are expiring on November 1st, 2007. It is recommended that you backup any data that you don’t want to lose as soon as possible. More information can be found at http://blogs.msdn.com/jeffbe/archive/2007/10/25/vs2008-beta2-vpcs-expiring-prematurely.aspx.
Read MoreHow Can AT&T Be So Cruel?
I just read an article how AT&T refused to give a fire victim in Southern California any slack regarding one of their receivers. You can read the full article at http://www.dslreports.com/shownews/ATT-Wants-300-From-Wildfire-Victim-88826. How cruel! I cannot believe they wouldn’t provide any lenience with their bill. Before I start receiving tons of comments supporting AT&T’s position, let’s evaluate their position. Let’s examine the facts. According to CNN, at least 1,635 homes have been destroyed. Let’s assume that every one of these homes have a $300 receiver. That means that AT&T is out $490,500. According to AT&T’s 3rd Quarter report, their free cash flow after dividends totaled $2.4 billion and total revenue equaled $30.1 billion. So, the $490k is less than 1% of their free cash flow and total revenues. The other arguement that could be made is that AT&T is worried that others who were not affected by the fires could be using this to their advantage. My arguement to AT&T would be to work with the major insurance companies and request a claim number from their customers. Hopefully DSLReports.com receives a positive response from AT&T.
Read MoreGmail IMAP Needs Improvement
I’m not impressed with the IMAP capabilities with Google Gmail. So far I’ve noticed that my IMAP connection has dropped numerous times. I’ve highlighted 60 spam messages in [Gmail]\Spam and hit delete while noticing timeouts. I’ve tried purging deleted items and noticed that the items delete only 5 at a time. And, I’ve used more than just Outlook 2007 to connect.
Read MorePennsylvania Cell Phone Ban - Hoax
I’ve been getting emails from numerous people about a Pennsylvania Cell Phone ban. There’s been two different letters going around. One looks like a legitimate house bill and the other looks like a legislative briefing (http://urbanlegends.about.com/library/n_pa_cell_phone_ban.htm). If you do a quick Google or Live.com search, you’ll quickly find that this is a hoax (such as http://urbanlegends.about.com/library/bl_pa_cell_phone_ban.htm). In fact, there is no legislation currently in the PA State Legislation system that pertains to a cell phone ban.
Read MoreMicrosoft Adds a Free 411 Number
Microsoft announced that they now offer a Free 411 number for callers to find a business. It is powered by Live Search. The phone number is 1-800-225-5411.
Read MoreVB.NET's yield return
I was struggling with an issue today when converting some C# to VB.NET. C# has a really cool yield return
statement that is used in an iterator block to provide a value to the enumerator object. VB.NET does not have the yield
keyword. So, there are a few solutions (none of which are really clean) to get around this. You could use a return statement to return the value if you are looping through and would like to break an enumerator and return a single value. However, if you’d like to return the entire enumeration, create a List()
of the child type and return the list. Since you are usually using this with an IEnumerable
, the List()
will work nice.