15.08.2013 Views

Ektron CMS400.NET Developer Reference Manual

Ektron CMS400.NET Developer Reference Manual

Ektron CMS400.NET Developer Reference Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

5. Add the following code to the code behind.<br />

IndexSearch1.Parm.XPath = "/root/subject"<br />

Dim arStr As String()<br />

Dim Str As String<br />

Dim strRet As String<br />

arStr = IndexSearch1.GetXPathValues("/root/subject")<br />

For Each Str In arStr<br />

Next<br />

strRet += Str & ""<br />

Literal1.Text = strRet<br />

Here is a description of what is happening in the code.<br />

• This line defines the parameter XPath location:<br />

IndexSearch1.Parm.XPath = "/root/subject"<br />

• The next three lines create variables:<br />

Dim arStr As String()<br />

Dim Str As String<br />

Dim strRet As String<br />

• This line set the variable arStr as an array of the XPathValues:<br />

arStr = IndexSearch1.GetXPathValues("/root/<br />

subject")<br />

• The for next loop iterates through the array of XPathValues:<br />

For Each Str In arStr<br />

strRet += Str & ""<br />

Next<br />

• The last line displays the values on your web form:<br />

Literal1.Text = strRet<br />

6. Build the project.<br />

7. Browse to your web form.<br />

8. The list of book subject titles appears.<br />

<strong>Ektron</strong> <strong>CMS400.NET</strong> <strong>Developer</strong> <strong>Reference</strong> <strong>Manual</strong>, Version 5.1, Revision 5 128

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!