Is there anyway i can call orderedFiles in my asp xml tags so that it displays the file associated with orderedFiles?
EDIT
Is it possible to replace the current filepath with a value in an xml document?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use databinding to set the value of the DocumentSource property at databind-time. First, in your code-behind, create a public or protected method that returns a string that contains the physical path to the file you want to display. In your case, this method would have the three lines of code you listed, and would return orderedFiles.FullName, which is the physical path to the newest file. Let’s say this method is called “GetFile()”, and it should look something like this:
Then In your markup, use databinding syntax to assign the DocumentSource property to the output of this method call:
Finally, you will need to make sure you kick off databinding on the page by calling Page.DataBind() at some point in your page load method.
If you want a good introduction to databinding, you can see this article by Dino Esposito