Locations of visitors to this page


Onteora Software - Ajax

Onteora Software

Ken Tucker's Blog

About the author

Author Name is someone.
E-mail me Send mail

Recent posts

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

VB Cascading Drop Down Example

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 ID="DropDownList3" runat="server"  Width="341px">
                    </asp:DropDownList>
                </td>
            </tr>
        </table>
    </div>
    <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1"
            Category="Make"  PromptText="Please select a make"  LoadingText="[Loading makes...]" ServiceMethod="GetDropDownContents">
    </cc1:CascadingDropDown>
    <cc1:CascadingDropDown ID="CascadingDropDown2" runat="server" TargetControlID="DropDownList2"
            Category="Model" PromptText="Please select a model" LoadingText="[Loading models...]"
            ServiceMethod="GetDropDownContents" ParentControlID="DropDownList1">
    </cc1:CascadingDropDown>
    <cc1:CascadingDropDown ID="CascadingDropDown3" runat="server" TargetControlID="DropDownList3"
            Category="Color" PromptText="Please select a color" LoadingText="[Loading colors...]"
            ServiceMethod="GetDropDownContents"
            ParentControlID="DropDownList2">
    </cc1:CascadingDropDown>
    </form>
</body>
</html>

 

In the code behind I am using a shared class so I only have to load the xml document once.

 

Imports System.Xml

Partial Class _Default
    Inherits System.Web.UI.Page

    <System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
 Public Shared Function GetDropDownContents(ByVal knownCategoryValues As String, ByVal category As String) As AjaxControlToolkit.CascadingDropDownNameValue()
        Dim knownCategoryValuesDictionary As StringDictionary = AjaxControlToolkit.CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues)

        Return AjaxControlToolkit.CascadingDropDown.QuerySimpleCascadingDropDownDocument(CarsInfo.Document, CarsInfo.Hierarchy, knownCategoryValuesDictionary, category)
    End Function
End Class


Public Class CarsInfo
    Private Shared _Doc As XmlDocument
    Private Shared _load As Boolean = True

    Public Shared ReadOnly Property Document() As XmlDocument
        Get
            If _load Then
                _Doc = New XmlDocument
                _Doc.Load(HttpContext.Current.Server.MapPath("~/App_Data/CarsService.xml"))
                _load = False
            End If
            Return _Doc
        End Get
    End Property

    Public Shared ReadOnly Property Hierarchy() As String()
        Get
            Return New String() {"make", "model"}
        End Get
    End Property
End Class

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax | VB
Posted by Ken Tucker on Tuesday, April 01, 2008 10:53 AM
Permalink | Comments (2) | Post RSSRSS comment feed

Use the AjaxSlideShowExtender to show pictures in a directory

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 />
                <br />
                <asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Larger" />
                <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
                <asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Larger" />
                <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server" TargetControlID="Image1"
                    SlideShowServiceMethod="GetPictures" AutoPlay="true" ImageDescriptionLabelID="imageLabel1"
                    NextButtonID="nextButton" PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="prevButton"
                    PlayButtonID="playButton" Loop="true" />
                <asp:Label ID="lblError" runat="server" />
            </div>
        </div>
    </form>
</body>
</html>

The Code Behind File

Imports System.IO
Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        MyData.ImagePath = Server.MapPath("~/Images")
        Dim strUrl As String = Request.Url.ToString

        MyData.Url = strUrl.Substring(0, strUrl.LastIndexOf("/")) & "/Images/"
    End Sub


    <System.Web.Services.WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Shared Function GetPictures() As AjaxControlToolkit.Slide()
        Dim di As New DirectoryInfo(MyData.ImagePath)
        Dim s(di.GetFiles.Length - 1) As AjaxControlToolkit.Slide
        Dim x As Integer = 0
        For Each fi As FileInfo In di.GetFiles()
            s(x) = New AjaxControlToolkit.Slide(MyData.Url & fi.Name, "", Path.GetFileNameWithoutExtension(fi.Name))
            x += 1
        Next
        Return s
    End Function
End Class

Public Class MyData
    Private Shared _Path As String
    Private Shared _Url As String

    Public Shared Property ImagePath() As String
        Get
            Return _Path
        End Get
        Set(ByVal value As String)
            _Path = value
        End Set
    End Property

    Public Shared Property Url() As String
        Get
            Return _Url
        End Get
        Set(ByVal value As String)
            _Url = value
        End Set
    End Property
End Class

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax
Posted by Ken Tucker on Thursday, May 31, 2007 4:12 AM
Permalink | Comments (2) | Post RSSRSS comment feed

AjaxToolKit Slide Show Control

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 I decided to use the FlickrNet library on the Code Plex website to get a list of the code camp photos. You will need an api key from Flickr to use this class library.


In this example I look up the username by the URL the photo collections is located. The I get a list of the photos by the username. The Flickr .Net library will create an xml file to cache the photo list by default. I turned this feature off because not all webservers will allow the dll to write to the bin directory the Flickr dll is located in.


Article about Flickr.Net API on Coding4Fun Website

Orlando Code Camp Photo Show
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>Orlando Code Camp Files</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" />
        <div>
            <div style="text-align: center">
                <asp:Image ID="Image1" runat="server" Height="300" Style="border: 1px solid black;
                    width: auto" ImageUrl="http://farm1.static.flickr.com/177/434079572_dd113d2313.jpg?v=0"
                    AlternateText="Orlando Code Camp" />
                <asp:Label runat="Server" ID="imageLabel1" /><br />
                <br />
                <asp:Button runat="Server" ID="prevButton" Text="Prev" Font-Size="Larger" />
                <asp:Button runat="Server" ID="playButton" Text="Play" Font-Size="Larger" />
                <asp:Button runat="Server" ID="nextButton" Text="Next" Font-Size="Larger" />
                <ajaxToolkit:SlideShowExtender ID="slideshowextend1" runat="server" TargetControlID="Image1"
                    SlideShowServiceMethod="GetPictures" AutoPlay="true" ImageDescriptionLabelID="imageLabel1"
                    NextButtonID="nextButton" PlayButtonText="Play" StopButtonText="Stop" PreviousButtonID="prevButton"
                    PlayButtonID="playButton" Loop="true" />
                <asp:Label ID="lblError" runat="server" />
            </div>
        </div>
    </form>
</body>
</html>



Code Behind File

Imports FlickrNet

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    <System.Web.Services.WebMethod()> _
  <System.Web.Script.Services.ScriptMethod()> _
   Public Shared Function GetPictures() As AjaxControlToolkit.Slide()
        Dim strApiKey As String = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
        Dim strSecret As String = "xxxxxxxxxxxxxxxxxxxxx"
        Flickr.CacheDisabled = True
        Dim f As New FlickrNet.Flickr()
        Try
            f.ApiKey = strApiKey
            f.ApiSecret = strSecret

            Dim user As FlickrNet.FoundUser = f.UrlsLookupUser("http://www.flickr.com/photos/onetug/sets/72157600026752869/")
            Dim ccPhotos As FlickrNet.Photos
            Dim so As New FlickrNet.PhotoSearchOptions
            so.UserId = user.UserId
            ccPhotos = f.PhotosSearch(so)

            Dim s(ccPhotos.PhotoCollection.Count) As AjaxControlToolkit.Slide

            For x As Integer = 0 To ccPhotos.PhotoCollection.Count - 1
                Dim ph As FlickrNet.Photo = ccPhotos.PhotoCollection.Item(x)
                s(x) = New AjaxControlToolkit.Slide(ph.MediumUrl, "", ph.Title)
            Next
            Return s
        Catch ex As Exception
            Dim s(0) As AjaxControlToolkit.Slide
            s(0) = New AjaxControlToolkit.Slide("http://static.flickr.com/186/435708815_c74ba67436_b.jpg", "", _
                "Shawn Weisfeld delivering the books to A Gift for Teaching")
            Return s
        End Try
    End Function

End Class

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax | VB
Posted by Ken Tucker on Thursday, April 05, 2007 10:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed

UpdatePanel Gotcha

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 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>

    <script type="text/javascript">
        function displayClick()
        {
            $get("span1").innerHTML="Hello World";
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            </asp:ScriptManager>
             <asp:UpdatePanel ID="UpdatePanel1" runat="server" >
                <ContentTemplate>
                   <span id="span1"></span>
                    <br />
                    <asp:linkButton runat="server" Text="Button" ID="button1" OnClientClick="displayClick();" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </form>
</body>
</html>

By moving the Span outside the update panel we will still be able to update the contents of the span without posting back. The UpdatePanel still prevents the pages postback.



<%@ 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 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>

    <script type="text/javascript">
        function displayClick()
        {
            $get("span1").innerHTML="Hello World";
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
            </asp:ScriptManager>
            <span id="span1"></span>
            <br />
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                <ContentTemplate>
                    <asp:LinkButton runat="server" Text="Button" ID="button1" OnClientClick="displayClick();" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </form>
</body>
</html>

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax
Posted by Ken Tucker on Wednesday, December 13, 2006 11:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Getting the Back Button to work with Ajax

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 web service will connect to the northwind database and return the company name for a customer id.  To make this webservice work with ajax we have to make the web service a ScriptService. 

 


Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.SqlClient
Imports System.Data
Imports System.Text

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Microsoft.Web.Script.Services.ScriptService()> _
Public Class Customers
    Inherits System.Web.Services.WebService

    <WebMethod()> _
    Public Function GetName(ByVal strID As String) As String
        Dim strOut As New StringBuilder
        Dim connStr As String
        connStr = "Server = .;Database = Northwind; integrated security=sspi;"
        Dim conn As New SqlConnection(connStr)
        Dim cmd As New SqlCommand
        Try
            conn.Open()
            If strID <> "" Then
                cmd = New SqlCommand("Select CompanyName From Customers where Customerid = @CustomerID", conn)
                cmd.Parameters.AddWithValue("@CustomerID", strID)
                strOut.Append("<html><body>")
                strOut.Append(cmd.ExecuteScalar.ToString())
                strOut.Append("</body></html>")
            End If
        Catch ex As Exception
            strOut.Append("<H1>Database Error</H1>")
        Finally
            conn.Close()
        End Try
        Return strOut.ToString

    End Function

End Class



We also have to make a change to the httpHandlers section of the web.config file for this to work.


    <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
    </httpHandlers>



Lets set up default.aspx to use the webservice for updating its content.  First we have to register the webservice with the pages script manager.

        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/Customers.asmx" /></Services>
        </asp:ScriptManager>

Now we need to make a callback function in java script for the web service.  This function will display the results.

    <script language="javascript" type="text/javascript">
          
       function displayName(results)
        {     
            $get("CompanyName").innerHTML = results;
        }       
    </script>

 

Of course we have to add a few controls to the form to display the data.  Here is the html for default.aspx.


<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!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>

    <script language="javascript" type="text/javascript">
          
       function displayName(results)
        {     
            $get("CompanyName").innerHTML = results;
        }       
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <Services>
            <asp:ServiceReference Path="~/Customers.asmx" /></Services>
        </asp:ScriptManager>
        <div>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <table>
                <tr>
                    <td>
                        <asp:DataList ID="DataList1" runat="server" DataKeyField="CustomerID" DataSourceID="SqlDataSource1">
                            <ItemTemplate>
                                <a href="javascript:Customers.GetName('<%# Eval("CustomerID") %>', displayName)">
                                    <%# Eval("CustomerID") %>
                                </a>
                                <br />
                            </ItemTemplate>
                        </asp:DataList>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>"
                            SelectCommand="SELECT [CustomerID] FROM [Customers]"></asp:SqlDataSource>
                    </td>
                    <td style='vertical-align:top; width: 50%;'>
                        <div id="CompanyName" >
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>

 



On the page we have a label lblNow which I use for displaying the time the page was displayed.  Here is the code behind file which updates the label



Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        lblNow.Text = Now.ToLongTimeString
    End Sub
End Class


So if we run the project you will see a list of the northwind product categories.  When you click on one of the customer id it will call a java script function which will display the company name.  You can see by the fact the time is not changing in the label the page is not posting back.

The browsers back button remembers when a webpage loads, posts back, or the page loaded in an IFrame changes.  So for the back button to work with ajax we need to add a hidden IFrame to the page.  The trick here is to get the page we navigate to in the iframe to update our webpage.

 

Add a new webpage to the project named History.aspx.  In the call back function we are using parent.document to change the div on the main form. Here is the html for the page.


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="history.aspx.vb" Inherits="history" %>

<!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>

    <script language="javascript" type="text/javascript">
                 
        function GetID()
        {
            var url=window.location.href;
            var idstring=url.split("?")[1];

            if(!idstring)
                return null;

            idstring=idstring.substr(("ID=").length);
            idstring=unescape(idstring);
            return idstring;
        }
       
        function displayResult(results)
        {
            parent.document.all.item("CompanyName").innerHTML = results;
        }
      
        function body_onload()
        {
         var idstring=GetID();
          if(idstring)
          {
             Customers.GetName(idstring, displayResult);
          }
        }
    </script>

</head>
<body onload="body_onload();">
    <form id="form1" runat="server">
        <div>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
                <Services>
                    <asp:ServiceReference Path="~/Customers.asmx" />
                </Services>
            </asp:ScriptManager>
        </div>
    </form>
</body>
</html>


Now we need to make some changes to default.aspx.  First we have to add a hidden iframe to the form.

 

            <iframe id="hiddeniframe" src="history.aspx" style='visibility: hidden;'></iframe>

 

Finally we have to get the link to change the page in the iframe instead of calling the web service.   Here is the updated pages html.


<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!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>

    <script language="javascript" type="text/javascript">
         
       function ChangeFrame(id)
       {
            window.frames["hiddeniframe"].location.href ="history.aspx?ID=" + id;
       }
 
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <table>
                <tr>
                    <td>
                        <asp:DataList ID="DataList1" runat="server" DataKeyField="CustomerID" DataSourceID="SqlDataSource1">
                            <ItemTemplate>
                                <a href="javascript:ChangeFrame('<%# Eval("CustomerID") %>')">
                                    <%# Eval("CustomerID") %>
                                </a>
                                <br />
                            </ItemTemplate>
                        </asp:DataList>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>"
                            SelectCommand="SELECT [CustomerID] FROM [Customers]"></asp:SqlDataSource>
                    </td>
                    <td style='vertical-align:top; width: 50%;'>
                        <div id="CompanyName" >
                        </div>
                    </td>
                </tr>
            </table>
            <iframe id="hiddeniframe" src="history.aspx" style='visibility: hidden;'></iframe>
        </div>
    </form>
</body>
</html>


Now when the user clicks on the link it calls a webpage in a hidden iframe which updates the main page.  The user now can use the back button

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax
Posted by Ken Tucker on Friday, November 10, 2006 3:12 AM
Permalink | Comments (1) | Post RSSRSS comment feed

Atlas Tool Kit

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 ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("link") %>'
                            Text='<%# Eval("title") %>'></asp:HyperLink><br />
                        <asp:Label ID="descriptionLabel" runat="server" Text='<%# Eval("description") %>'></asp:Label><br />
                        <br />
                        pubDate:
                        <asp:Label ID="pubDateLabel" runat="server" Text='<%# Eval("pubDate") %>'></asp:Label><br />
                        <br />
                    </ItemTemplate>
                    <AlternatingItemStyle BackColor="#F7F7F7" />
                    <ItemStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                    <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                </asp:DataList><cc1:RssDataSource ID="RssDataSource1" runat="server" MaxItems="0"
                    Url="http://www.vb-tips.com/newsfeed.aspx">
                </cc1:RssDataSource>
            </asp:Panel>
           <atlas:ScriptManager ID="s1" EnablePartialRendering="true" runat="server">
            </atlas:ScriptManager>

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax
Posted by Ken Tucker on Sunday, May 07, 2006 10:12 PM
Permalink | Comments (0) | Post RSSRSS comment feed

Atlas April Ctp Released

Atlas April Ctp Released



The April CTP of Atlas was released today. Along with a toolkit that has some cool tools.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax
Posted by Ken Tucker on Thursday, April 13, 2006 11:42 AM
Permalink | Comments (0) | Post RSSRSS comment feed

Atlas March Ctp Released

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.


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Categories: Ajax
Posted by Ken Tucker on Monday, March 20, 2006 11:42 AM
Permalink | Comments (0) | Post RSSRSS comment feed