Small changes to make adding multiple items to the Links widget faster.

Topics: ASP.NET 2.0
Jul 5, 2009 at 11:40 PM
Edited Jul 5, 2009 at 11:41 PM

I just migrated my own personal blog to BlogEngine.Net from Blogger and while going through the setup process for BlogEngine.Net I got rather annoyed when adding only a few links to the Links widget. The add form stays open, which is great, however the fields are not cleared out and the focus does not change back to the first field on the form. Here's a few quick lines of code that you can add to the bottom of the add button's click event handler to make adding multiple items a lot easier.

Add the following code immediately before the end of the btnAdd_Click function.

this.txtTitle.Text = "";
this.txtUrl.Text = "";
this.cbNewWindow.Checked = false;
this.txtTitle.Focus();