I had a problem recently in an application I was writing where I popped up a dialog box (jQuery Dialog) with a registration partial view. Once the user successfully registered, I checked to see if the request was an ajax request (Request.IsAjaxRequest()) and returned RedirectToAction to go to the home page. However, what ended up happening was this result was being shown in the Dialog box. As you can imagine, it was the full front page in the dialog, on top of the front page.
This was happening because the Ajax.BeginForm AjaxOptions UpdateTargetId was set and the result was being forced into that element regardless of the type of action being returned. To get around this I first returned a PartialRegistrationSuccess view that just said “Registration Successful. Please close this window and login”. I wasn’t very happy with this because without the AJAX request, the user was automatically logged in.
What I ended up doing was returning a partial login view that had a normal form on it (Html.BeginForm). This way, when the user logged in through the dialog box, the full page was redirected back to the home page on success, or a full login page on failure. This is much more graceful than the registration success message.
I may have mentioned this before, but it’s worth stating again. I follow almost all of the product blogs for the products I use. And when I can’t find one, I try and contact the vendor/developers and ask them if they can put one up. Sometimes I get a reply that there is a mailing list, which works for me as long as it is low traffic.
Today I was looking for RSS feeds for TrueCrypt and KeePass, which I’ve mentioned here before. Neither site had an RSS feed, but both sites had a news section somewhere on their website. I’ve seen this in a lot of places, and I’m wondering why there aren’t more RSS feeds available when people have news sections?
Product update information – especially security related updates – are important to get out to as many users and quickly as possible. If you develop anything open source, or available for others to use, please make an attempt to get the information out as quickly as possible – and maybe on as many mediums as possible.
I’m also going to post a list of the common product RSS feeds I follow so others can get to them easily.
I use a lot of tools in my .NET development projects that I like to keep in my source control repository so all developers have the same version and mostly the same configuration. I do set up my projects so these can generally be overridden, but the build system uses the ones I keep in the repository for standards sake.
Recently I’ve been seeing a lot of tools released (specifically from Microsoft) that only come in .msi format. I don’t like this because it means I either have to install the msi (which then makes the tool dependent on my platform), or I have to extract the files and add them manually to my repository.
A quick Google search for “extracting msi files” revealed a really nice blog post Howto: extract files from a .msi file using the Windows command line . Go there and learn how to extract MSI files and then add them manually to a tools repository and link externally to this repository.
I buy a few tech gadgets once in a while (okay whenever I have the money for cool toys). And sometimes my fancy tech gadgets break. And I wonder if it is still under warranty (or if I filed the warranty at all). Well, this Lifehacker WarrantyElephant article discusses a new website called WarrantyElephant that has definitely convinced me to both fill out the warranty information and keep track of the information easily.
WarrantyElephant, in a nutshell, is a way to keep track of warranty information and receive alerts when your warranties are going to expire! I definitely recommend going to the website and checking it out. I am actually going to take out my file folder with warrantee cards and move them all to this site sometime later today.
I love things that make my programs act like vi when I need to edit or jump to things quickly. Among the vi addons I use are: viPlugin for Eclipse, viEmu for Visual Studio and SQL Server Management Studio, and Vimperator for Firefox.
I was coding on a rather large project recently using Zend Studio for Eclipse with viPlugin. It adds vi functionality to Eclipse, which is really handy for coding. I was talking to Chris Weldon about it and how I wanted to have the ability to copy multiple lines of code into reusable buffers. I use snippets in Visual Studio for this same functionality, and I knew vi had a way to do it, but I had forgotten what it did.
Buffers
Introducing buffers… Buffers are vi’s answer to snippets. By default, any time you delete, yank, or change an open file, that line is saved in the default buffer. But you can add your own custom buffers using the ” character. Example: “ayy would yank the current line into a buffer name “a”. To reuse that buffer, simply execute in command mode: “ap to paste below or “aP to append to the current position. Buffers are a great way to increase your efficiency when you absolutely have to repeat lines multiple times (say across multiple files).
Marks
I also showed Chris how to use marks, which are basically bookmarks in a document. Marks are added to a document using ‘<mark_name> (single quote – mark name). Example: If you are on line 50 of a file, and you do ‘a and then jump to line 75 (75gg), you can easily jump back to line 50 using ma (go to mark “a”). Both IDEs that I use regularly (Visual Studio and Eclipse) have bookmark functionailty built in, but it is generally a much more involved process to add and jump to bookmarks.
There is one caveat to using viPlugin and viEmu – they don’t allow you to show registers and saved bookmarks! Another vi plugin I use for Firefox (Vimperator) does allow you to show saved bookmarks and registers by using the standard vim commands :bookmarks and :registers, respectively. I have filed bug reports for them and hope to see this functionality appear soon!