Seems that I occasionally need to trigger the postback on an UpdatePanel, and invariably I forget between usages. Since this particular post from Encosia has saved my bacon on more than one occasion, I shall share it here (and for my own future benefit): Easily refresh an UpdatePanel, using JavaScript | Encosia: I’ve noticed a lot of discussion lately regarding methods to refresh an UpdatePanel via client script. This is very easy on the server side, of course. You can just call UpdatePanel.Update(). However, on the client side, the most common solutions I’ve been seeing just don’t feel right. Many will advise you to use a hidden button control inside the UpdatePanel, manipulated via, to trigger a partial postback[…]

Someone on the ASP.NET forums asked how to set session variables in JavaScript. The answers given ranged from “totally wrong” to “rather misleading” or “marginally helpful”. So in a nutshell, yes, you can totally do it. Not only will you be able to do it, you will love doing it after you get used to the process of getting it set up. Here’s the recipe for success: Add an ASP.NET AJAX ScriptManager to your page. Create a simple ASMX Web service using Visual Studio. Uncomment the Attribute directly above the class definition that reads [System.Web.Script.Services.ScriptService] to enable ASP.NET AJAX to see your web methods. Create a method to get or update data in your session, and make sure the Attribute[…]

I had run into this problem before. Setup I have my Visual Studio 2008 options set to reload the previously loaded solution on startup. I use Subversion. I use AnkhSVN as my SVN provider in Visual Studio 2008. Problem If I launched Visual Studio 2008 with a particular solution loaded when I last closed VS, I would receive a “Source control provider could not be found” error. However… if I just launched it via double-clicking on the .SLN file in my file system, no error!!! Weird. OK – so I did a quick diff on a solution that I knew worked fine. Both had the expected source control provider information embedded: SccProjectName = “Svn” SccAuxPath = “Svn” SccLocalPath = “Svn”[…]

Found this forum post to be very helpful and I think I may employ this more often when doing UpdatePanel related messaging-when-done… Run a javascript function after UpdatePanel.Update() – ASP.NET Forums: … You should call the method in this way: ScriptManager.RegisterStartupScript(this.Page, this.GetType(), “MyScriptName”, “<script type=’text/javascript’>functionToCall(‘hello world’);</script>”, false); The problem could be the fact that you are using this instead of this.Page. Also instead language=’javascript’ you can use type=’text/javascript’. All I know is that when I launched the script properly passing this.Page it worked properly. I had derived from Page to a custom base page, so maybe that had something to do with it. Additionally, I refined it just a bit by building the script dynamically in a string and then[…]

OK this one has been baffling me for a long time but I just ignored it. We have been using the open source logging library log4net for a long time, and for the most part it was working fine. But the one thing that I wanted to do but could never get working was logging to what my brain wanted to call “The Console,” AKA (to me) the Output window in Visual Studio. I tried using the log4net appenders ConsoleAppender and ColoredConsoleAppender, to no avail. Turns out there’s a different appender that works with the Output window, and it’s not ConsoleAppender. The appender in question is TraceAppender! So here’s a little snippet of XML from my web.config files that handles[…]