How to create a Data View Web Part that triggers a connection from the Drop-down view style in FrontPage 2003 (838685)



The information in this article applies to:

  • Microsoft Office FrontPage 2003

INTRODUCTION

This article describes how to create a Data View Web Part by using the drop-down view style in Microsoft Office FrontPage 2003. The drop-down view style in FrontPage 2003 triggers a connection when you select a record on a Web page in your Web browser.

MORE INFORMATION

To create a Data View Web Part by using a drop-down view style, follow these steps:
  1. Start FrontPage 2003.
  2. Open a default Microsoft Windows SharePoint Services Web site in FrontPage 2003.
  3. Under Folder List, double-click the Default.aspx file to open it in Design view.
  4. Create two Data View Web Parts. To do this, follow these steps:
    1. On the Data menu, click Insert Data View.
    2. In the Data Source Catalog pane, select any data source to create a Data View Web Part. For example, you can create two Data View Web Parts by using the Announcements list data source.
    3. For this example, click Announcements under SharePoint Lists, and then click Insert Data View.
    4. Repeat step 4.c to insert a second Announcements list Data View Web Part.
  5. Change the style of the first Data View Web Part. To do this, follow these steps:
    1. Above the Title column in the first Announcements list Data View Web Part, click the drop down arrow on the Data View Options tab, and then click Style.
    2. In the View Styles dialog box, click HTML view.
    3. In the HTML view styles list box, locate the Dropdown menu of titles style, and then click the Dropdown menu of titles style.
    4. Click OK.
    5. Click Yes when you receive the following message: If you change the view style, any custom formatting or provider Web Part connections will be removed. Do you want to continue?
  6. Connect the first Announcements list Data View Web Part to the second Announcements list Data View Web Part. To do this, follow these steps:
    1. Right-click the first Announcements list Data View Web Part, and then click Web Part Connections.
    2. In the Web Part Connections Wizard, click Provide Data Values To under Choose the action on the source Web Part to use for this connection, and then click Next.
    3. Click Connect to a Web Part on this page, and then click Next.
    4. Under Target Web Part, click the second Announcements list, and then click Next.
    5. Under Columns in first Announcements list, click Title, click Title under Columns in second Announcements list, and then click Next.
    6. Click Title in the Create a hyperlink on: list, and then click Next.
    7. Click Finish.
  7. Update the underlying code to create the Data View Web Part that triggers a connection. To do this, follow these steps:
    1. Click the Code view.
    2. Locate the following tag:
      <select name="ID" size="1">
      Change the tag as follows:
      <select name="ID" size="1" onchange="eval(this.options.value)">  
       
    3. Locate the following tag:
      <a target="_self">
      Locate the following code:
      <xsl:attribute name="href"><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="cursel">dvt_curselkey={<xsl:value-of select="$CurrentRowKey"/>}</xsl:variable><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="fields">@ProductID=<xsl:value-of select="ddwrt:ConnEncode(string(@ProductID))"/></xsl:variable>javascript:<xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="ddwrt:GenFireConnection(concat('a9abe436-4cb7-4f23-affb-a11913e68ee3*',$fields),string($cursel))"></xsl:value-of></xsl:attribute>
    4. Copy the code that you found in step 7c, and then paste the code immediately before the following code:
      <a target="_self">
      The result will be similar to the following:
      <xsl:attribute name="href"><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="cursel">dvt_curselkey={<xsl:value-of select="$CurrentRowKey"/>}</xsl:variable><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="fields">@ProductID=<xsl:value-of select="ddwrt:ConnEncode(string(@ProductID))"/></xsl:variable>javascript:<xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="ddwrt:GenFireConnection(concat('a9abe436-4cb7-4f23-affb-a11913e68ee3*',$fields),string($cursel))"></xsl:value-of></xsl:attribute>
      <a target="_self">
    5. Find the name="href" line and replace it with name="value" in the newly pasted code:
      <xsl:attribute name="value"><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="cursel">dvt_curselkey={<xsl:value-of select="$CurrentRowKey"/>}</xsl:variable><xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="fields">@ProductID=<xsl:value-of select="ddwrt:ConnEncode(string(@ProductID))"/></xsl:variable>javascript:<xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="ddwrt:GenFireConnection(concat('a9abe436-4cb7-4f23-affb-a11913e68ee3*',$fields),string($cursel))"></xsl:value-of></xsl:attribute>
  8. On the File menu, click Save.
  9. To verify the changes that you made in the Web page by using the FrontPage 2003, follow these steps:
    1. On the File menu, point to Preview in Browser, and then click Microsoft Internet Explorer 6.0.
    2. Locate the first Announcements list Data View Web Part list box, and then select any title.
Notice that the record for the corresponding title appears in the second Announcements list Data View Web Part.

Modification Type:MajorLast Reviewed:8/6/2004
Keywords:kbhowto KB838685 kbAudITPRO