Ajax
Here is simple VB example of the AjaxToolkit's CascadingDropDown extender. For this example I use the CarsService.Xml found in the AjaxToolkits sample site. The xml file needs to be placed in the App_data directory
Here is the Pages Html
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="sm1" EnablePageMethods="true" runat="server">
</asp:ScriptManager>
<table>
<tr>
<td>
Make
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="341px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Model
</td>
<td>
<asp:DropDownList ID="DropDownList2" runat="server" Width="341px">
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
Color
</td>
<td>
<asp:DropDownList...
Use the AjaxSlideShowExtender to show pictures in a directory
The AjaxSlideShowExtender will automatically display a slide show in an image control. The slide show extender calls a shared function to get a list of slides. This tip shows hows to create slide of all the images in a folder.
The Pages HTML
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<div style="text-align: center">
<asp:Image ID="Image1" runat="server" Height="300" Style="border: 1px solid black;
width: auto" ImageUrl="images/ajax.jpg"
AlternateText="Ajax" />
<asp:Label runat="Server" ID="imageLabel1" /><br...
Getting the Back Button to work with Ajax
Microsoft's Asp.Net Ajax makes it easy to create a web page that can refresh itself with out posting back. Unfortunately when a web page updates itself using ajax the user is unable to press the back button to get back to what is was on the page before. In this article I will first show to create an ajax enable website which uses a webservice to update itself. Then we will make the back button work properly.
First create a new AjaxEnabledWebsite and lets start off by adding a webservice to the Project named Customers. This...
AjaxToolKit Slide Show Control
While working on the Orlando Code Camp website I decided to add a page which shows a slide show of the pictures taken at code camp. The new Ajax Tool Kit Slide Show Control was perfect for this task. The photos were uploaded to the Flickr website.
The Slide Show control requires a shared (static c#) function which would return an Array of Slides. The slide class contains a link to the photo, the photos name, and description of the photo. Since I did not want to store a list of photos in a database or xml file...
UpdatePanel Gotcha
Do not update the contents inside a UpdatePanel with java script. You will not get the resuts you expect.
For example place a span and button inside an update panel.When you click on a button control the java script onClientClick will fire followed by the Click event for the button. So if we update the span's text with onClientClick the text will update briefly then the UpdatePanel will catch the post back made by the click event and erase our changes.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
Namespace="Microsoft.Web.UI" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD...
Atlas Tool Kit
The atlas tool kit is truely awsome. I see there is an error in collapsiblepanelextender documentation. The sample code on the webpage shows the expanddirection as height when the valid values are horizontal and vertical. It also shows openedsize instead of expandedsize.
<atlasToolkit:CollapsiblePanelExtender ID="cpe" runat="Server">
<atlasToolkit:CollapsiblePanelProperties ExpandedSize="200" TargetControlID="pnlRss"
ExpandControlID="LinkButton1" CollapseControlID="LinkButton1" Collapsed="True"
TextLabelID="LinkButton1" CollapsedText="Show Details..." ExpandedText="Hide Details..."
SuppressPostBack="true" />
</atlasToolkit:CollapsiblePanelExtender>
<asp:Label ID="lblRss" Text="Whats New in VB-Tips" runat="server"></asp:Label>
<asp:LinkButton ID="LinkButton1" runat="server" Text="Show Details..">
</asp:LinkButton>
<asp:Panel ID="pnlRss" runat="server" Width="100%" ScrollBars="Vertical">
<asp:DataList ID="DataList1" runat="server" BackColor="White" BorderColor="#E7E7FF"
BorderStyle="None" BorderWidth="1px" CellPadding="3" DataSourceID="RssDataSource1"
GridLines="Horizontal">
<FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
<SelectedItemStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
<ItemTemplate>
<asp:HyperLink...
Atlas April Ctp Released
The April CTP of Atlas was released today. Along with a toolkit that has some cool tools.
Atlas March Ctp Released
The March CTP of Atlas was released today. It is the first version of Atlas to have a go live license.