Friday, 22 January 2010

Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it


Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it

If you've used the Microsoft ASP.NET AJAX UpdatePanel control, there's a good chance you've hit the "Sys.WebForms.PageRequestManagerParserErrorException" error.


http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx

Thursday, 21 January 2010

Javascript: protocol


Useful explanation on the" javascript:" protocol


Vertical alignment in DIV


Here is a good article on how vertial alignment works in CSS and how to vertically align elements in DIV tags.

Monday, 7 December 2009

An error occurred while validating. HRESULT = '80004005'


You may have received this error when compiling a setup project within visual studio...

Roughly translated, this error message means "Cannot built setup, dependent project is missing, missing a reference or a referenced file for a project cannot be found."

For example, add a project output to the setup file, and apply one of the content files to the setup (I.e. use an icon for the add/remove programs icon). Remove the project out, then re-add it. Visual studio will then give you this error (despite the project output being in there!!)... Everytime an output is removed, you must re-reference all of the dependencies.

If it is not this specific issue, then there is something wrong with your projects. Look up the projects' references and see if they are all correct. Try to compile the projects as well, this is a good indication that you aren't adding projects with errors to your set-up!

Adding a project/installer to VSS (where you want it to go!)


If you have a solution in visual studio, its probably made up of many relationships and dependencies. If the solution isn't source controlled immediately, you might run into a couple of issues putting it in Visual Souresafe (VSS) exactly where you want it to go.
The same goes for installers, and adding new installers to an existing source controlled solution.

The key is to add it to VSS before dependencies are added... otherwise, it'll pick up the fact that its above the binding root of the solution, and put it inside the folder you want, but inside two child nodes down; or something silly like that.

So the best way is to remove dependencies, or source control it before they are added!

Friday, 4 December 2009

Attach a database file to SQL Server


If you have a SQL Server Database file (.mdf) and the associated logfile (.ldf), you can attach this manually to an SQL Server database.

Here's a Microsoft link explaining the process:

BackgroundWorker - Handling Exceptions


Today i've been using Background Workers in visual studio and came to a bit of a fix when I needed to throw an expcetion within the DoWork event of the worker.

Normally, you would expect to throw exceptions as usual, but due to the nature of how the worker handles exceptions; this is done a little differently...

The worker automatically handles exceptions and passes them as an argument to the RunWorkerCompleted event. From the developers perspective, you just need to throw them within the DoWork event.
In the RunWorkerCompleted event, the RunWorkerCompletedEventArgs object contains an "Error" property. Simply test for null here to know weather an error has occurred... here you can catch your exception!

Thursday, 19 November 2009

DIV Layout with CSS (Table vs. DIV Layout)


Here is a nice article explaining the differences between HTML table and DIV based layouts. It gives examples of each and how to move forward with DIV based layouts.

http://www.devarticles.com/c/a/Web-Style-Sheets/DIV-Based-Layout-with-CSS/

Add User Controls to an ASP.NET page


Heres an artircle on how to add a user control to an ASP.NET page, its quite informitive and details all of the necessary steps

http://msdn.microsoft.com/en-us/library/5d0t5fak(VS.71).aspx

Friday, 13 November 2009

onclick vs. onmousedown and onmouseup


I've been trying for the last couple of hours as to why I couldn't select a row in my GridView using right click... it seemed to work fine for left click, but right click had issues (I had my attribute for the row set to 'onclick')

What I was doing so making a context menu appear, but I wanted the row to select itself before the menu appeared. After many vain attempts of simulating left click behaviour, adding pointers to the left clicks behaviour into the code... I simply changed the attribute to onmouseup, and presto! it works!

strange, but I do recall when attemping to disable right clicks on webpages, the onmousedown/up event is captured, so it must be how the browser interprets the keypresses for each.