I am fetching the admin side vacancy in client side
currenty admin side three vacancy available and I am displaying three vacancy in client side
In client side display the three vacancy
problem is there I want to display each vacancy display separate
currently all vacancy display together that is main problem
if no vacancy available admin side then display client side no content available
for example:
what I want to:
- <div class="row">
- <div class="col-md-6">
-
- </div>
- <div class="col-md-6">
-
- </div>
- </div>
- <div class="row">
- <div class="col-md-6">
-
- </div>
- <div class="col-md-6">
-
- </div>
- </div>
if no vacancy admin side then below display image
admin side vacancy:
client side vacancy(here I fetch the admin vacancy):
ViewModel
- public class ViewModel
- {
- public Career Career { get; set; }
- public List<Vacancy> Vacancy { get; set; }
- [NotMapped]
- public SelectList vacancyselectlist { get; set; }
- }
-
- public class Career
- {
- [Key]
- public int usercarrerid { get; set; }
-
- public string useremailid { get; set; }
-
- public string usercontactno { get; set; }
-
- public string userresume { get; set; }
-
- public Nullable<int> vacancyid { get; set; }
-
- [ForeignKey("vacancyid")]
- public Vacancy vacancy { get; set; }
-
- }
-
- public class Vacancy
- {
- public int vacancyid { get; set; }
- public string vacancytitle { get; set; }
- public string vacancyposition { get; set; }
- public string vacancyexperience { get; set; }
- public string vacancyjobdescription { get; set; }
- public string vacancyrequiredskill { get; set; }
- }
Career.cshtml
HomeController.cs
- [HttpGet]
- public async Task<ActionResult> Career(List<Vacancy> _vacancy)
- {
-
- HttpResponseMessage responseMessage = client.GetAsync("https://localhost:44325/Home/DisplayVacancyData").Result; //here I am fetching admin side vacancy to client side
-
- if (responseMessage.IsSuccessStatusCode)
- {
-
-
- if (_vacancy.Count == 0)
- {
- ViewBag.message = "No content Available";
- }
- else
- {
- return View("Career", test);
- }
- }
- return View("Index");
- }
problem is here
- @carr.vacancytitle
- @carr.vacancyposition
- @carr.vacancyexperience
which place to add foreach loop because data is dynamic here can not use for loop
here need to implement foreach loop because data is dynamic not static
please help