February 25, 2010
Events on any html document bubble from child up to parent calling the handlers on each element until it reaches the Body.
In order to stop this from happening you can cancel the bubble by setting the cancelBubble property on the event to true
<INPUT TYPE=”TEXT” NAME=”TEXT1″ onclick=”alert(‘TEXT1′);event.cancelBubble=true;”>Name
Taken from http://webdevelopersjournal.com/articles/jsevents2/jsevents2.html
tags: HTML, Javascript
posted in Uncategorized by admin | No Comments
February 22, 2010
tags: ASP.Net Webforms
posted in Programming by admin | No Comments
February 15, 2010
This post I’ll keep short and sweet.
If you are using a Regular Expression Validator you will have the problem that if you use a line break it won’t validate when you write something like ^.{0,n}$ even though the dot is supposed to match anything
Apparently the dot isn’t supposed to match new line characters
I took the following from http://weblogs.asp.net/cosgood/archive/2003/05/06/6604.aspx although the wrong bracket is used to close off the cardinality
^(.|\s){0,n}$
That’s it, just remember to escape the backslash depending on where you are setting the expression.
tags: ASP.Net Webforms
posted in Uncategorized by admin | 4 Comments
January 13, 2010
It recently began to annoy me that every time I want to redirect to a page I have to use a string. Not a big deal I know but when you have broken links it can reflect badly on you as a developer, so I began to look for some solution that would allow for the following.
- Refactoring: I need to be able to move a page around without having to find every string reference to it
- No Reflection: It’s slow I don’t want to have to use it when redirects happen often.
- Parameters: I want to be able to pass parameters to a function and make that become part of the get request, I want the logic for that to exist on the page being redirected to as that is where the parameters are being used, this will also help with refactoring, the plain ole redirect logic however would just exist on a base class, don’t want to have to rewrite for every page.
I knew the ideal situation would be if I could somehow use the fact that web application projects use the folder hierarchy for its namespace convention and end up being able to redirect to the page ~/Users/UserDetails.aspx?UserId=14 with the following command Users.UserDetails.Redirect(14);
Here is how I did it: Continue Reading »
tags: ASP.net, C#, Resharper, Web Application Projects, Web Forms
posted in Programming by admin | No Comments
November 29, 2009
I’ve been using the alpha version of google wave for about a month and a half, and I have to say that I’m a fan. This post is mostly about saying why I’m a fan and also why I think that google wave is going to change the way we communicate through text.
The reason I’m writing this post is because there are a lot of people who have heard bits about it or just haven’t spent the time using it and really can’t see why this is such a big deal. Hopefully this post will go some way towards convincing you of it’s merit, but feel free to add your own insights in as comments.
Google Wave has been described by Google as what email would look like had it been designed in the 21st century. Wave is standing on the shoulders of giants, it reflects the evolution of internet communication by bringing together mature concepts as the principals or requirements of their system and uses new technology to hold it all together. It’s worth keeping this in mind when you think about the future of Google Wave. It may be new, but there is so much to this that we’ve seen before. My first reaction on using Google Wave was, “Is that it?”. The real shocker was when after a short time using Google Wave I was coming back to my trusty MSN messenger and finding it unpleasant to use.
Continue Reading »
tags: Email, Google, Google Wave, Internet Communication
posted in Service Providers, Software by admin | 2 Comments
November 24, 2009
I was using the __dopostback function in asp.net to cause a postback that would trigger an update in an updatepanel where relevant.
If you come across this problem make sure that your custom control implements the INamingContainer as well as the IPostBackEventHandler interfaces
Also make sure that your first argument to the __dopostback function is the unique id of your custom control (this.UniqueId)
tags: asp.net ajax.net javascript
posted in Programming, Troubleshooting by admin | No Comments
October 13, 2009
I find mocking the http context rather difficult, you can’t inherit from it and making a wrapper class is a lot of work. Thankfully someone came up with a solution, unfortunately the link they included with the code is dead and I can’t seem to remember where I got the code, if anyone finds out where it comes from please comment and I’ll add it to the post.
Continue Reading »
tags: ASP.net, C#, httpcontext, mocking
posted in Testing by admin | No Comments
September 16, 2009
Just started using the ASP.Net Web Forms wrapper for JqGrid, worth taking a look at
http://trirand.net/default.aspx
tags: ASP.Net Webforms, JqGrid, JqGrid.Net, Jquery UI
posted in Programming by admin | No Comments
September 10, 2009
First look at the official JqGrid ASP.Net Web Forms control here http://www.trirand.net/jqgrid.aspx
Includes support for Linq and object data sources.
tags: ASP.net, ASP.Net Webforms, JqGrid, JQuery, Jquery UI
posted in Programming by admin | No Comments
September 10, 2009

Last night I was at the first meeting of the local alt.net book club, we’re currently going through a book called the art of unit testing. What I took from reading the first chapter and the discussion we had at the meeting was that you test your code already, your tests can be improved and unit testing will improve it. My first mistake was to confuse what unit testing was. I thought it was just automated testing. I had used a unit testing framework and that’s all that I had learnt from doing so. However once you start reading up on the best practices of testing you hear a different story.
Continue Reading »
tags: Integration Testing, Testing, The Art of Unit Testing, Unit Testing
posted in Testing by admin | No Comments