Oct22

Unrecoverable build error

Categories: Visual Studio, Errors, ASP.NET
Ouch.  This error has bothered me for a couple of days now, and I finally found a solution.  I kept getting this error when I was building a depolyment project. First, you should try Microsoft's Knowledge Base article on the problem: http://suppo...
 
Sep20

Check to see if a string is empty

Categories: ASP.NET C#
There are several ways to check a string to see if it’s empty.  However, you should try to always use the following method.  It’s faster, and uses less resources.  This may seem like a minimal piece of code - but if you were checking strings through...
 
Aug10

Adding a ListItem to a dynamic dropdown list

Categories: ASP.NET C#
If you manually add a listitem to a dynamic dropdown list, ensure that you set the appenddatabounditems attribute to true.  If you don’t, the dynamic items will overwrite the ones you manually added. <asp:dropdownlist id="DevelopmentCycleDr...
 
May8

Compiler Error Message: CS0030: Cannot convert type ‘ASP.login_aspx’ to ‘System.Web.UI.WebControls.Login’

Categories: ASP.NET C#
Argh. What a silly error this is. There are a couple of things that need to happen for this to happen in .net. 1. You precompiled your app (2.0)2. You publish your site as ‘updateable’3. You named a page that is the same as a Class in .net Most deve...
 
Jan17

.NET Framework Library Source Code

Categories: ASP.NET C#
Want to debug the .net framework?  Or super geeky and just want to see how it's all done?  The .NET framework libraries' source is now available. .NET Base Class Libraries (including System, System.CodeDom, System.Collections, System.ComponentModel...
 
Aug30

Allow Only Numbers In A String - C#

Categories: ASP.NET C#
Often you may have user input that needs to only be numbers, and the input doesn’t allow characters.  There is javascript that you can put on the front end to limit what keystrokes can be made in an input field; however, there are still ways around ...
 
Jul31

Difference between two Dates

Categories: ASP.NET C#
Here’s some useful code if you need to know how much time has elapsed between two days.         DateTime oldDate = new DateTime(2005, 7, 31);         DateTime newDate = DateTime.Now;           // Difference in days, hours, and minutes.         Time...
 
Jul18

Regular Expression Library

Categories: ASP.NET C#
Regular Expressions.  Joy oh Joy.  Here’s a great site to help ease the pain in writing one: Regular Expression Library.  They have over a thousand indexed expressions and it even has an online tool to help you test expressions: http://www.regexlib....
 
May9

Use an Image in a HyperLinkColumn

Categories: ASP.NET C#
I’ve seen a lot of posts on boards of people inquiring how to utilize an image in a hyperlinkcolumn.  I found those posts, because I was trying to do the same thing.  In my codebehind, I had some custom things going on for the link, and really didn’...
 
Apr14

Determine how many records are in a DataSet

Categories: ASP.NET C#
To determine how many records are in a dataset, you can use the Count method of the Rows in a table (last line in code).         // New DataSet         DataSet dbSet = new DataSet();           // Populate DataSet with data         dbAdapt....
 
 Next >>