Microsoft KB Archive/838685

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

Article ID: 838685

Article Last Modified on 8/6/2004

-

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:  Start FrontPage 2003. Open a default Microsoft Windows SharePoint Services Web site in FrontPage 2003. Under Folder List, double-click the Default.aspx file to open it in Design view. Create two Data View Web Parts. To do this, follow these steps:  On the Data menu, click Insert Data View. 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. For this example, click Announcements under SharePoint Lists, and then click Insert Data View.</li> Repeat step 4.c to insert a second Announcements list Data View Web Part.</li></ol> </li> Change the style of the first Data View Web Part. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> 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.</li> In the View Styles dialog box, click HTML view.</li> In the HTML view styles list box, locate the Dropdown menu of titles style, and then click the Dropdown menu of titles style.</li> Click OK.</li> 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?

</li></ol> </li> Connect the first Announcements list Data View Web Part to the second Announcements list Data View Web Part. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Right-click the first Announcements list Data View Web Part, and then click Web Part Connections.</li> 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.</li> Click Connect to a Web Part on this page, and then click Next.</li> Under Target Web Part, click the second Announcements list, and then click Next.</li> Under Columns in , click Title, click Title under Columns in  , and then click Next.</li> Click Title in the Create a hyperlink on: list, and then click Next.</li> Click Finish.</li></ol> </li> <li>Update the underlying code to create the Data View Web Part that triggers a connection. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Click the Code view.</li> <li> Locate the following tag: <select name=&quot;ID&quot; size=&quot;1&quot;> Change the tag as follows: <select name=&quot;ID&quot; size=&quot;1&quot; onchange=&quot;eval(this.options.value)&quot;> </li> <li> Locate the following tag: <a target=&quot;_self&quot;> Locate the following code: <xsl:attribute name=&quot;href&quot;><xsl:variable xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; name=&quot;cursel&quot;>dvt_curselkey={<xsl:value-of select=&quot;$CurrentRowKey&quot;/>}</xsl:variable><xsl:variable xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; name=&quot;fields&quot;>@ProductID=<xsl:value-of select=&quot;ddwrt:ConnEncode(string(@ProductID))&quot;/></xsl:variable>javascript:<xsl:value-of xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; select=&quot;ddwrt:GenFireConnection(concat('a9abe436-4cb7-4f23-affb-a11913e68ee3*',$fields),string($cursel))&quot;></xsl:value-of></xsl:attribute> </li> <li> Copy the code that you found in step 7c, and then paste the code immediately before the following code: <a target=&quot;_self&quot;> The result will be similar to the following: <xsl:attribute name=&quot;href&quot;><xsl:variable xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; name=&quot;cursel&quot;>dvt_curselkey={<xsl:value-of select=&quot;$CurrentRowKey&quot;/>}</xsl:variable><xsl:variable xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; name=&quot;fields&quot;>@ProductID=<xsl:value-of select=&quot;ddwrt:ConnEncode(string(@ProductID))&quot;/></xsl:variable>javascript:<xsl:value-of xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; select=&quot;ddwrt:GenFireConnection(concat('a9abe436-4cb7-4f23-affb-a11913e68ee3*',$fields),string($cursel))&quot;></xsl:value-of></xsl:attribute> <a target=&quot;_self&quot;> </li> <li> Find the name=”href” line and replace it with name=“value” in the newly pasted code: <xsl:attribute name=&quot;value&quot;><xsl:variable xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; name=&quot;cursel&quot;>dvt_curselkey={<xsl:value-of select=&quot;$CurrentRowKey&quot;/>}</xsl:variable><xsl:variable xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; name=&quot;fields&quot;>@ProductID=<xsl:value-of select=&quot;ddwrt:ConnEncode(string(@ProductID))&quot;/></xsl:variable>javascript:<xsl:value-of xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; select=&quot;ddwrt:GenFireConnection(concat('a9abe436-4cb7-4f23-affb-a11913e68ee3*',$fields),string($cursel))&quot;></xsl:value-of></xsl:attribute> </li></ol> </li> <li>On the File menu, click Save.</li> <li>To verify the changes that you made in the Web page by using the FrontPage 2003, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>On the File menu, point to Preview in Browser, and then click Microsoft Internet Explorer 6.0.</li> <li>Locate the first Announcements list Data View Web Part list box, and then select any title.</li></ol> </li></ol>

Notice that the record for the corresponding title appears in the second Announcements list Data View Web Part.

Keywords: kbhowto KB838685

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.