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 7440305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:49:51+00:00 2026-05-29T10:49:51+00:00

@using System.Configuration @using UI.AuctionService @using UI.Common @using UI.Helpers @model UI.Models.AuctionFrontendListViewModel @{ ViewBag.Title = Auction

  • 0
@using System.Configuration
@using UI.AuctionService
@using UI.Common
@using UI.Helpers

@model UI.Models.AuctionFrontendListViewModel

@{
    ViewBag.Title = "Auction List";
}

<h2>@Model.Title</h2>

<table>
    <tr>
        <th>
            Image
        </th>
        <th>
            Type
        </th>
        <th>
            Auction title
        </th>
        <th>
            Starts
        </th>
        <th>
            Ends
        </th>
        <th>
            Is featured
        </th>
        <th>
            Bid count
        </th>
        <th>
            Creation time
        </th>
        <th></th>   
    </tr>

@foreach (var auction in Model.Auctions)
{
    var type = string.Empty;
    if (auction.Auction is LubAuction)
    {
        type = "Lowest unique wins";
    }
    else if (auction.Auction is EsfAuction)
    {
        type = "Highest wins";
    }

    string imagesFolderPath = HttpContextHelper.GetPathInServer(ConfigurationManager.AppSettings["ImagesFolderPath"]);
    string itemImagesFolderPath = Path.Combine(imagesFolderPath, ImageType.Item + @"\\" + auction.Auction.InventoryReference);
    string chosenImage = string.Empty;
    if (Directory.Exists(itemImagesFolderPath))
    {
        string[] files = Directory.GetFiles(itemImagesFolderPath);
        if (files.Length > 0)
        {
            chosenImage = files[0];
        }
    }

    <tr>
       <td>
            <img src="@chosenImage" />
       </td>
       <td>
            @type
       </td>
       <td>
            @Html.DisplayFor(modelItem => auction.Auction.Title)
        </td>
        <td>
            @DateTimeHelper.LocalDateTime(auction.Auction.Starts)
        </td>
        <td>
            @DateTimeHelper.LocalDateTime(auction.Auction.Ends)
        </td>
        <td>
            @Html.DisplayFor(modelItem => auction.Auction.IsFeatured)
        </td>
        <td>
            @Html.DisplayFor(modelItem => auction.Auction.BidCount)
        </td>
        <td>
            @DateTimeHelper.LocalDateTime(auction.Auction.AddedDate)
        </td>
        <td>
           @Html.ActionLink("Details", "Details", new { id = auction.Auction.Id })
        </td>
    </tr>
}

</table>
<div class="pager">
@Html.PageLinks(Model.PagingInfo, x => Url.Action(Model.Action, new { page = x }))
</div>
  • 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-05-29T10:49:53+00:00Added an answer on May 29, 2026 at 10:49 am

    If the image is the issue, I would suggest doing this differently. Your Razor view probably shouldn’t be in charge of scouring the server to look for images; consider pushing that info into the view through the model or ViewData.

    In addition, why are you passing in @"\\" to Path.Combine? You’re adding a double-slash to the path. Let Path.Combine handle this instead. I think that’s probably your main problem. Do one of the following:

    string itemImagesFolderPath = Path.Combine(imagesFolderPath, ImageType.Item + @"\" + auction.Auction.InventoryReference);
    

    or, more preferably

    string itemImagesFolderPath = Path.Combine(imagesFolderPath, ImageType.Item, auction.Auction.InventoryReference);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
How to load application settings to NHibernate.Cfg.Configuration object by using System.Configuration.ConfigurationManager from App.config?
using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI;
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security;
Using .NET 2.0. System.Drawing is in my References list. Here is my using statement:
I am using System.Configuration to encrypt and protect some passwords in a custom configuration
I have the following code block: - using System.ComponentModel.DataAnnotations; public class NewsItem { [RegularExpression(System.Configuration.ConfigurationSettings.AppSettings[UrlRegEx],
I can add the statement using System.Configuration; to my code using intellisense, but I
I have the following code: using System.Configuration; namespace test { public partial class MyService
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenericCount { class Program {

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.