Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
How to hide some parts in .Net 4.7?

I'm working at a property management website. There are sold properties that i don't want to show to the users. What should I do with it? Should I make changes in the controller or the view?

This is my Sold properties controller code.

public ActionResult ViewSoldProperties()
    {
        ViewBag.Principles = db.UCDs.GetUCDs(UCLTypes.PropertyStatus).AsUcdSelectList();

        var propertiesViewAll = db.Properties.Where(x => x.IsDeleted == false && x.Status == 2353).OrderByDescending(i => i.ID);
        var ucds = db.UCDs.AsNoTracking().ActiveOnly().ToList();
        foreach (var i in propertiesViewAll)
        {
            i.StatusName = ucds.Where(x => x.ID == i.Status).Select(t => t.Title).FirstOrDefault();

            i.FinancingName = ucds.Where(x => x.ID == i.Financing).Select(t => t.Title).FirstOrDefault();

            System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();

            client.BaseAddress = new Uri("http://gis.hcpafl.org/propertysearch/#/search/basic/address=" + i.StreetAddress + " " + i.RouteAddress + ", " + i.City);
            //Address2 is used as base address
            i.Address2 = client.BaseAddress.ToString();
            var compId = db.BuyingInfoes.Where(x => x.PropertyID == i.ID).Select(x => x.CompanyID).FirstOrDefault();
            if (compId != null)
            {
                var compAbbr = db.Owners.Where(x => x.ID == compId).Select(x => x.CompanyAbbreviation).FirstOrDefault();
                if (compAbbr != null)
                {
                    i.OwnerAbbriviation = compAbbr;
                }
            }
        }
        ViewBag.data = propertiesViewAll;
        //if (NumberOfRecords != null)
        //{
        //    return PartialView("PartialViewAll");
        //}
        return View();

Below are the images I want to hide from the customers on the live website.

These are the example images I don't want to show to the users

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!