August 2006 - Posts

Atlas TabStrip with Asynchronous Callback

I've been thinking about how to dynamically load the contents for different panes from the previous Tabstrip example.  I accomplished this using the UpdatePanel with the Asp.net Multiview control.  You can check the end result in the demo below.  If time permits and after working out the kinks, I'll post the source here.

Demo: http://atlas.vertigosoftware.com/atlastabstrip2/tabstrip.aspx
Source: http://blogs.vertigosoftware.com/files/alan/atlastabstrip2.aspx

Update:  I added the source after some minor code cleanup and tweaks.  There is still more work to make it better.  Some ideas include adding nice effects when or after  the update panel is updated, only reload the tab panes if they haven't been loaded yet, apply better styling and css.  Let me know if you run into any issues.




posted by AlanL with 8 Comments

Atlas TabStrip

I found this gem on Bertrand Le Roy's blog and it's exactly what I needed to replace the IE TabStrip control from ASP.NET 1.1.  The original author posted the code sample on the ASP.Net Forums.  One issue with the post is that there is no working demo of this great code sample or downloadable source as echoed in the comments. I took the liberty to create quick demo and provide the source as a file-system based Atlas web project.  All credit for the code goes to Kwang Suh and Bertrand Le Roy.

The sample code eloquently uses div tags, ul tag, and css.  It works in both IE and Firefox. In addition, the javascript code is encapsulated within a single .js file and reference with the Atlas ScriptManager. 

Check it out for yourself.  Below is a demo that represents the output of the Kwang Suh's code without any edits.  You can download the source or just take a look at the individual files as text.

Demo: http://atlas.vertigosoftware.com/atlastabstrip/

Source: http://blogs.vertigosoftware.com/files/alan/atlastabstrip.zip
Default.aspx: http://atlas.vertigosoftware.com/atlastabstrip/default.aspx
TabSet.js: http://atlas.vertigosoftware.com/atlastabstrip/TabSet.js

Update: I've created a different version of the TabStrip that will perform asynchronous postback with the update panel.

Posted using the new Windows Live Writer.

posted by AlanL with 10 Comments

Atlas: Building Collapsible Panels with Atlas

The CollapsiblePanelExpander, as the name implies, allows us to easily add collapase and expand functionality to any section on the sites that we build with Atlas.  Here is a quick look at some of the different ways that we can build collapsible panels using this robust extender.  You can check out the five quick demos and the accompanying source code.  I've also made the website project available.

The code should be really self-explanatory, so there's no indepth explanation like my previous posts on Atlas.

Demo: http://atlas.vertigosoftware.com/atlascollapsiblepanel/
Source: http://atlas.vertigosoftware.com/atlascollapsiblepanel/default.aspx.txt
Download: http://blogs.vertigosoftware.com/files/alan/atlascollapsiblepanel.zip

P.S.  The demo link is down. so I posted a mirror of the demo here: http://alanle.com/atlas/atlascollapsiblepanel/default.aspx

posted by AlanL with 1 Comments

Ampersand in Title Tag Throws Atlas Unknown Error

I ran into a strange problem today working with the July CTP (it probably in earlier CTPs as well).

I had a fairly simple Atlas page that uses update panels. The page would continually throw an "Unknown Error" alert box when the update panel is being updated. Curiously, the cause of the error turns out not to be due to the Atlas UpdatePanel controls I had on the page but because I had an ampersand (&) in the title tag. Changing the "&" sign to an "and" fixed it.

Here's a simplified repro of the bug.

<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<
script runat="server">
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text =
string.Format("Hello {0}, the time is {1}.", TextBox1.Text, DateTime.Now.ToLongTimeString());
    }
</script>

<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
    <title>Copy & Paste</title>
</
head>
<
body>
    <form id="form1" runat="server">
        <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering=true />
        <atlas:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" /><br />
                <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
            </ContentTemplate>
        </atlas:UpdatePanel>
    </form>
</
body>
</
html>

A quick search of the Atlas forums revealed that others already have ran into this problem before and the issue is more generic to special characters in the title tag. In addition to this bug, forum members Gavin and Luis Abreu have compiled an unofficial list of Atlas bugs as reported in the Atlas Forums. It's a good idea to go through this list to get a general feel about the reported bugs by Atlas forum members and things to avoid in the Atlas CTP until they are fixed.  Since these releases are Community Tech Previews, it's understandable that there are bugs in the framework.

Update: Hannes Preishuber suggests setting ValidateRequest="false" in the page directive as a solution.


posted by AlanL with 5 Comments