ASP.NET AJAX Control Toolkit: Transparent Tab Control Images
Posted by Ryan Baxter Thu, 10 Apr 2008 15:18:00 GMT
I’ve found a use for the Tab Control that is included with the ASP.NET AJAX Control Toolkit. The control’s default style is passable for now, but I’ve grown tired of looking at the white borders surrounding active tabs. If your background is not white, you’ve probably noticed this too.
To fix this, I’ve edited the images and posted them here. I’m not sure why the two active tab images were missed when all of the other images have transparent borders. Here are the before and after shots. Please don’t use these.
| Before | After | |
![]() |
![]() |
- Meta no trackbacks, no comments, permalink, rss, atom
Setting Focus in ASP.NET Ajax Pages
Posted by Ryan Baxter Mon, 31 Mar 2008 22:24:00 GMT

At the new job I’ve been using a lot of ASP.NET Ajax to help ease the transition of users from VB6 desktop applications to web applications on our company intranet. In doing this, the UpdatePanel has become my new best friend. Albeit charming, my old ASP.NET 2.0 friends were not as impressed.
With ASP.NET 2.0, came the long-awaited Focus method that allowed developers to set the page focus without having to write any JavaScript. Developers loved it and all was right with the world. That is until ASP.NET Ajax showed up.
I recently spent way too much time trying set the page focus on a page that contained just a few TextBox controls and an UpdatePanel. My site’s ScriptManager was located in a MasterPage, but more on that later. My obligatory googling turned up many work arounds, but none as simple as the following:
// Example
if (Page.IsPostback)
{
// Use the GetCurrent method if your ScriptManager is located
// in a MasterPage. Word.
ScriptManager.GetCurrent(this.Page).SetFocus(TextBox1);
}
else
{
// Here is the money.
AjaxControlToolkit.Utility.SetFocusOnLoad(TextBox2);
}The above example is a two-fer. The ScriptManager’s SetFocus method is handy, but remember that only one ScriptManager is allowed per page and if you’ve put your ScriptManager in a MasterPage, then you’ll need to access it in code using the GetCurrent method of the ScriptManager class.
Two. The ASP.NET 2.0 UpdatePanel is not the only Ajax control. Download the ASP.NET Ajax Control Toolkit. With this toolkit, you’ll have access to dozens of controls and best of all – the SetFocusOnLoad method. Located in the Utility class, the SetFocusOnLoad method is the answer to your !Page.IsPostback problems.
- Posted in Code Snippets
- Meta no trackbacks, no comments, permalink, rss, atom



