Punjabi Killaz
New Member
I have a page with a video at the top and a list of videos you can choose from. Currently, clicking a link in the video list will reload the entire page. I need it to only refresh the partial view I have containing the video at the top of the page.I saw several posts here on SO showing how to reload partial views with JQuery, but couldn't get it to work correctly in my situation. I'm unsure how to pass the correct id of the video along.Controller:\[code\] public ActionResult Videos(int topVideo = 0) { VideosModel model = new VideosModel(); model.Videos = StatsVideoService.GetEntityList(new Lookup(TableStatsVideo.IsDeleted, false)).OrderByDescending(x => x.DateCreated).ToList(); if (topVideo == 0) model.TopVideo = model.Videos.First(); else { model.TopVideo = model.Videos.Where(x => x.StatsVideoId == topVideo).FirstOrDefault(); if (model.TopVideo == null) model.TopVideo = model.Videos.First(); } return View(model); }\[/code\]View:\[code\]@model Project.Models.VideosModel<section class="videos"> <div id="top_video"> @{Html.RenderPartial("StatsVideo", Model.TopVideo);} </div> <ul> @foreach (var item in Model.Videos) { <li> <div class="videoList"> <a href ="http://stackoverflow.com/questions/14419436/@Url.Action("Videos", "Home", new { topVideo = item.StatsVideoId })"> <img src="http://stackoverflow.com/questions/14419436/@Url.Content("~/Content/img/video-ph.png")" /> </a> <p class="videoTitle">@item.Title</p> </div> </li> } </ul></section>\[/code\]If there's any more information needed, please let me know.