Saturday, November 8th, 2008
As jQuery is being shipped with the MVC framework I suppose I will have to move away from Prototype -oh well I am sure what I learnt won’t be wasted.
It would be so useful if Visual Studio provided some intelisense for JavaScript (more than it does actually give) so after a small amout of Googling I found this post:
http://brennan.offwhite.net/blog/2008/02/01/intellisense-for-jquery-in-visual-studio-2008/
Bit of an update:
http://weblogs.asp.net/bleroy/archive/2008/11/07/visual-studio-patched-for-better-jquery-intellisense.aspx
Posted in .NET, jQuery | No Comments »
Thursday, November 6th, 2008
Posted in .NET, Castle Windsor, videos | No Comments »
Thursday, October 30th, 2008
Posted in .NET | No Comments »
Thursday, October 23rd, 2008
Useful for random stuff:
int[] array = new int[6] {1,2,3,4,5,6};
Console.WriteLine(”BEFORE”);
foreach (int i in array)
{
Console.WriteLine(i.ToString());
}
Random rng = new Random();
int n = array.Length;
while (n > 1)
{
int k = rng.Next(n);
n–;
int temp = array[n];
array[n] = array[k];
array[k] = temp;
}
Console.WriteLine(”AFTER”);
foreach (int i in array)
{
Console.WriteLine(i.ToString());
}
Console.ReadLine();
Posted in .NET | No Comments »
Thursday, October 23rd, 2008
I like reading Scott Gu’s blog there is usually some really good stuff on there including a large list of tips and tricks:
http://weblogs.asp.net/scottgu/pages/ASP.NET-2.0-Tips_2C00_-Tricks_2C00_-Recipes-and-Gotchas.aspx
Posted in .NET | No Comments »
Thursday, October 23rd, 2008
If you are just testing something you might pop a class in the App_Code directory (I was messing with extending web controls) you may need to the reference the assembly for that class. You can by using “__code”.
Here is what I did:
<%@ Register TagPrefix=”ExtendedAnchor” Assembly=”__code” Namespace=”WhatEver.Namespace”%>
Jobs a good’en!
Posted in .NET | No Comments »
Saturday, August 2nd, 2008
I have been refactoring my code recently and pulling all of the table adapters on an older site into repositories ready to be ported accross to NHibernate. By doing this I now have static Table Adapters in the repositories. This was all fine on dev and uat but when it wen live this caused this error:
There is already an open DataReader associated with this Command which must be closed first.
This I suppose makes sense when there are many requests hitting the same table adapter at once now that it is static. To solve this problem I have added:
MultipleActiveResultSets=True
To the connection string. This does make sense but I am going to have to have a good think if having the table adapters as static properties in the repositories is a good thing - I suppose just getting in all ported to NHibernate would be a better idea!
This URL was handy!:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=123691&SiteID=1
Posted in .NET | No Comments »
Tuesday, July 15th, 2008
Posted in .NET | No Comments »
Thursday, June 19th, 2008
This can be very annoying sometimes. I know it is not best to be running IIS on XP but sometimes you just have to. When running a local host you may want another member of your team to view your site or you may be running some regretional testing such as selenium test runner and you need to be able to hit the site more than just the once. Instead you just get a 403.9 error.
To alleviate this problem (not fully) you can do the following:
- remove HTTP Keep-Alives Enabled
- reduce the connection timeout
- and then run this: adsutil set w3svc/MaxConnections 40 Found: c:/Inetpub\AdminScripts
http://weblogs.asp.net/cazzu/archive/2003/10/10/31476.aspx
Posted in .NET, Hosting, IIS, Uncategorized | No Comments »
Monday, June 9th, 2008
Sometimes .NET really winds me up. Why do they by default put things that could potentially give a hacker some information. I know security by obscurity is not the best way forward but why leave your front door open!
Anywho - it is really easy to get rid of:
Find or add the element <httpRuntime> in your web.config and add the attribute enableVersionHeader=”false”.
The msd documentation can be found here: http://msdn.microsoft.com/en-us/library/e1f13641.aspx
Posted in .NET | No Comments »