Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8591387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:31:01+00:00 2026-06-11T23:31:01+00:00

I have an application that creates PDFs and stores them on a file within

  • 0

I have an application that creates PDFs and stores them on a file within the website. I need to loop through each of those files and find documents with a specific name on it. I’m able to create that list without any issues, but getting stumped with the best method to create my links

This is what I have so far:

string rootFolderPath = Server.MapPath("~/Forms/Offers");
string listOfBidSheets = @"*" + prospect.LastName.Trim() + "_" + prospect.FirstName.Trim() + "*";
string[] fileList = System.IO.Directory.GetFiles(rootFolderPath, listOfBidSheets);

if (fileList.Length > 0)
{  
    rptPDFLinks.DataSource = fileList;
    rptPDFLinks.DataBind();
}

The part that is stumping me is what to put on the front-end of the code:

<li><%# DataBinder.Eval(Container.DataItem, "Item") %></li>

Normally when I bind to a repeater the Container.DataItems are easy because they are column names.

Any thoughts on where to take this? I’m open to different solutions all together.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:31:03+00:00Added an answer on June 11, 2026 at 11:31 pm

    The DataBinder class is a fine way to render a property of the DataItem with some optional formatting. In your case the DataItem is just a string so you don’t want to use the DataBinder. You can directly use the DataItem as such:

    <li><%# Container.DataItem %></li> 
    

    This code won’t give you a link though. You want to do something like this:

    <li><a href="/Forms/Offers/<%# Container.DataItem %>"><%# Container.DataItem %></a></li>
    

    You also need to strip out the path from the file names. Here’s an example using some LINQ (you need to add ‘using System.Linq’ at the top of your file:

    rptPDFLinks.DataSource = fileList.Select(x => System.IO.Path.GetFileName(x));
    rptPDFLinks.DataBind(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that creates an audio file. I need to provide a
We have an MVC application that creates entity models and stores them in a
I have an application that creates a playlist of videos and returns them in
I have an application that creates a separate database (SQL Server 2008) for each
We have an application that creates a number of Visual Foxpro (DBF) tables. Each
I have an application that creates a log file on external device and passes
I have an application that creates trees of nodes, then tosses them and makes
So i have an application that creates like 2000 objects. For each object, it
I have an application that creates user notifications when various things happen within the
I have an application that creates entities in offline mode then saves them to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.