Archives / 2007 / August
  • Force Refresh of DataSourceControl

    I had a situation where I was using a DataSourceControl (actually an LLBLGenProDataSource2,which inherits from DataSourceControl) bound to a grid, and I wanted the grid to refresh its contents whenever I added or deleted an item from it.  I discovered a neat trick noted here, which is that if you touch the SelectParameters collection of the DataSourceControl, it will cause it to DataBind in its PreRender stage.  So in my case, wherever I wanted it to rebind my grid, I would simply do this: PaymentDataSource.SelectParameters.Add("foo", "0"); // hack to force grid to rebind In my case I wasn't using any parameters, and this is probably not the *best* way to do this, but it's 2am and … more

  • Reset Visual Studio Settings

    If you're working with Visual Studio 2008 (Orcas) Beta builds, of which there are now two, you may have run into problems if you tried to install Beta 2 on the same machine on which you had installed Beta 1.  While this is generally not advisable with any beta, I'm told it's working for a great many people.  Nonetheless, one behavior you may see is that after installing Beta 2 certain portions of Visual Studio continue to reference the Beta 1 settings under Visual Studio Codename Orcas for instance.  One thing you can do that will help with this issue is to run the following from the command line:devenv.exe /resetsettingsThis will clear out the Beta 1 settings for … more

  • FIX: LoginView Has No Child Controls

    We ran into this issue today: A LoginView control that has always worked just fine was failing to have any contents on a PostBack.  Stepping through it and checking things in the Immediate Window confirmed that it had a Controls.Count of 0.  Looking at it in ASP.NET Trace also showed that, after a postback, it had no controls below it in the control tree.  This was a problem since it contained a DropDownList and a TextBox that we needed to save the contents of in a click handler, but they were null.Of course we were accessing these sub-controls using the recursive FindControl() method that should be included in ASP.NET some day.  The LoginView had worked before, but in … more

  • Real World ASP.NET Performance Tuning Experience

    I'm in the midst of wrapping up a multi-year long project to replace the advertising engine used to host sponsored ads on a few dozen .NET web sites.  This system traces its "lineage" back to an old ASP application written in 2001 (it served its first 207 impressions on 31 March 2001), and has since been upgraded to ASP.NET 1.0 and 2.0 both as incremental ports, not full revisions (for instance, the database remained constant between these ports, and there was never any decent UI for managing the ads (basically direct table access).  Anyway, the system has grown and grown and now serves about 100M impressions per month, which if you do the math works out to an … more