Problem. I try to do a photo gallery

Last post 11-08-2005 3:34 PM by WilcoB. 1 replies.

Sort Posts:

  • Problem. I try to do a photo gallery

    11-07-2005, 5:41 PM
    • Member
      10 point Member
    • sergiofr
    • Member since 11-07-2005, 10:28 PM
    • Posts 2

    Hi. I try to do a photo gallery. I have a ListView and a atlas:Image. I try to do when I press on the list of photos load the photo that i selected in asp:image outside of the my listview. I have try to solve this using <atlas:Binding DataPath="foto" property='associatedElement' propertyKey='src' value="<%= image1.ImageUrl %> /> 
    but it does not work. Somebody can help me to solve this? Thanks you very much.

    The source code:

    <!
    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></title>
    <atlas:Script ID="Script1" runat="server" Path="~/ScriptLibrary/AtlasCompat.js" Browser="Mozilla" />
    <atlas:Script ID="Script2" runat="server" Path="~/ScriptLibrary/AtlasCompat.js" Browser="Firefox" />
    <atlas:Script ID="Script3" runat="server" Path="~/ScriptLibrary/AtlasCompat.js" Browser="AppleMAC-Safari" />
    <
    atlas:Script ID="Script4" runat="server" Path="~/ScriptLibrary/AtlasCore.js" />
    <atlas:Script ID="Script5" runat="server" Path="~/ScriptLibrary/AtlasCompat2.js" Browser="AppleMAC-Safari" />
    </
    head>

    <body>

    <form id="Form1" runat="server">

    <atlas:ScriptManager ID="AtlasPage1" runat="server"></atlas:ScriptManager>

    <div class="page" id="links">

    <div id="content">

    <atlas:Image id="imagenPrincipal" runat="server"></atlas:Image>

    <atlas:DataSource runat="server" ID="dataSource1" ServiceUrl="Localizacion2.asmx">

    <DataAvailable Handler="traceDataAvailable" />

    </atlas:DataSource>

    <atlas:ListView runat="server" ID="listView1"

    ItemTemplateControlID="templateItem"

    SeparatorTemplateControlID="separatorTemplate"

    AlternatingItemCssClass="aliceblue" ItemCssClass="azure">

    <Bindings>

    <atlas:Binding DataContext="dataSource1" DataPath="data" Property="data" />

    </Bindings>

    <LayoutTemplate>

    <ul runat="server" id="templateItemParent">

    <li runat="server" id="templateItem">

    <b>

    <atlas:Image runat="server" ID="image1">

    <Behaviors>

    <atlas:ClickBehavior>

    <Click>

    <Actions>

    <atlas:SetPropertyAction Target="imagenPrincipal" property='associatedElement' propertyKey='src'><Bindings><atlas:Binding DataPath="foto" property='associatedElement' propertyKey='src'/></Bindings></atlas:SetPropertyAction>

    </Actions>

    </Click>

    </atlas:ClickBehavior>

    </Behaviors>

    <Bindings>

    <atlas:Binding DataPath="foto" property='associatedElement' propertyKey='src' value="<%= image1.ImageUrl %> />

    </Bindings>

    </atlas:Image>

    </li>

    </ul>

    </LayoutTemplate>

    <EmptyTemplate>No data</EmptyTemplate>

    </atlas:ListView>

    <br />

    <atlas:Button runat="server" ID="fillButton" Text="Get data">

    <Click>

    <Actions>

    <atlas:InvokeMethodAction Target="dataSource1" Method="select" />

    </Actions>

    </Click>

    </atlas:Button>

    </div>

    </div>

    </form>

     

    </body>

    </html>

  • Re: Problem. I try to do a photo gallery

    11-08-2005, 3:34 PM
    • Participant
      1,454 point Participant
    • WilcoB
    • Member since 03-02-2003, 8:02 AM
    • Posts 290
    First of all, I recommend that you use the SetProperty action to set the property "imageURL" of the image, instead of directly accessing the src attribute of the associated element.

    Second of all, actions have their own data context. That means that you can't directly refer to a property of a data item without explicitly using a different data context. You can use a different data context by changing your action's binding to something like this:

    <atlas:Binding DataContext="sender.dataContext" DataPath="foto" ... />

    - Wilco Bauwer (MSFT) / http://www.wilcob.com
Page 1 of 1 (2 items)