No error messages, just nothing.Īny ideas/comments would be greatly appreciated.įunction on master page function ShowAlert(heading,message) ') ", alertHeading, alertMessage) ĬlientScript.RegisterStartupScript(this. Passing simple text messages such as "Hello World" work fine, but if I want to display something more complicated such as html code or output text from an error exception then the modal just doesn't appear. I pass the text I want to display to a Jquery function (also on the master page) which alters the text on the modal. I have an empty modal on the master page that I call if I want to display any kind of message on the screen to the user. Where(e => e.TeamId = id).I am building a web forms project using a combination of C#, Bootstrap and Jquery. Index action would handled the _DetailTeamPartialView autometically. Though, your _DetailTeamPartialView is alrigh and no vital issue has not seen, = "_DetailTeamPartialView" Īs you are using HTML Tag helper class that is Html.PartialAsync("_DetailTeamPartialView", item) so you don't need to use below Detail action on your controller. Member (var item in => => Html.PartialAsync("_DetailTeamPartialView", item) Just need to use Include(a => a.TeamMembers) which the action. Only Index action is capable here what you are trying to achieve. Note: You are doing the mess here as you are using another details action for the _DetailTeamPartialView which is complete Irelevant here. Var teamList = _(a => a.TeamMembers).ToList() Public TeamController(IWebHostEnvironment environment, ApplicationDbContext context) Private readonly IWebHostEnvironment _environment Private readonly ApplicationDbContext _context So not repeating that part.Ĭontroller: public class TeamController : Controller If that is the business scenario, then I would say, your approach were wrong and you are doing mess of course here thus, follow the steps below which will help to resolve your issue. Now the wizard will ask you to connect and configure the Connection String to the database. Then the Entity Data Model Wizard will open up where you need to select EF Designer database option. Nontheless, I tried to visualize what you are trying to achieve.įrom the shared code, I have managed to build above output therefore, the expected behaviour might be while clicking on details button on the team's list which is the index page should display the details list of all the team member of that particular team. From the Add New Item window, select ADO.NET Entity Data Model and set its Name as NorthwindModel and then click Add. I have gone through your shared code snippet between the line altough, you haven't shared your index page's code that certainly playing important role here. Master Detail not showing details table in modal popup - ASP.NET Core '' in (int i = 0 i < i++)' return 0 why? Public virtual List TeamMembers = new List() This code displays only team details and doesn't show the TeamMember details. In my project, the pop-up opens properly, but no data is loaded inside the modal. _DetailTeamPartialView.cshtml: = "_DetailTeamPartialView" Index.cshtml detail button: Html.PartialAsync("_DetailTeamPartialView", item) Return PartialView("_DetailTeamPartialView", team) Where(e => e.TeamId = id).FirstOrDefault() TeamController: public IActionResult Detail(int id) I followed this post to perform the Create operation and it is ok, now i am doing the Detail operation: I am doing CRUD operations on a Master Detail models Team and TeamMember using modal popup.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |