EnderWolf
EnderWolf
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
I think it all works now! I found this video and followed it. https://youtu.be/S6Eq0g7GGJk?si=aabPgFFcH-1Afnr4
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
I feel like that should be able to help me, but I've not yet leant a lot of the concepts it's talking about such as factory. thank you for trying to help me though! I will still keep trying to learn stuff from that link
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
I see, I'll take a look at that link. ty!
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
The idea was to have the events page that would open with different data/background colours based on the id. but I can always just make a bunch of individual pages for each option in the drop down, though I thought doing it this way would allow better code reusability
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
this is more or less just a personal project to work on between finishing my diploma and starting uni. the idea is for it to also help a small fandom I am a part of, but the main goal is just something to do in my spare time that I enjoy as to not turn coding into a thing I only do for work/study
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
Ah alright. Makes sense. I'm willing to change from blazor server, that was just my best guess at what would work best.
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
Would I place all this code, that get's the data from the database in the page's file?
List<Event> events = _context.Event.AsNoTracking()
.Where(c => c.EventTribe == id && c.EventStatus == 1 || c.EventTribe == 11 && c.EventStatus == 1)
.OrderBy(c => c.EventYear)
.ToList();
List<Event> events = _context.Event.AsNoTracking()
.Where(c => c.EventTribe == id && c.EventStatus == 1 || c.EventTribe == 11 && c.EventStatus == 1)
.OrderBy(c => c.EventYear)
.ToList();
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
Sorry, I was asleep. I'll give that a go thank you
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
Server. The drop down is in the nav bar of the site. So, I think a new page??
16 replies
CC#
Created by EnderWolf on 1/21/2024 in #help
✅ MVC to Blazor
The view
@{
ViewData["Title"] = "Index";
int tribe = int.Parse(@Context.Request.RouteValues["id"].ToString());
string tribeName = "";
string tribeColor = "";
switch(tribe)
{
case 0:
tribeName = "Nightwings";
tribeColor = "#8c54d1";
break;
case 1:
tribeName = "Icewings";
tribeColor = "#a5c9d6";
break;
//more of the above
}
}

<body style="background-color:@tribeColor">
<div class="container">
<h1 class="d-inline">Lore of the @tribeName</h1>
<table class="table">
<thead>
<tr>
<th class="col-2">Name</th>
<th class="col-4">Description</th>
<th class="col-2">Year</th>
<th class="col-1">Type</th>
<th class="col-2">Submited By</th>
<th class="col-2"></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventName)
</div>
</td>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventDescription)
</div>
</td>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventYear)
</div>
</td>
<td>
<div class="Event-Rows">
@switch (item.EventType)
{
case 0:
<text>None</text>
break;
//More of the above
}
</div>
</td>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventSubmitedBy)
</div>
</td>
<td>
<div class="btn-group d-flex">
<a class="btn btn-danger m-1" asp-action="Delete" asp-route-id="@item.EventId">Delete</a>
<a class="btn btn-dark m-1" asp-action="Details" asp-route-id="@item.EventId">Details</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</body>
@{
ViewData["Title"] = "Index";
int tribe = int.Parse(@Context.Request.RouteValues["id"].ToString());
string tribeName = "";
string tribeColor = "";
switch(tribe)
{
case 0:
tribeName = "Nightwings";
tribeColor = "#8c54d1";
break;
case 1:
tribeName = "Icewings";
tribeColor = "#a5c9d6";
break;
//more of the above
}
}

<body style="background-color:@tribeColor">
<div class="container">
<h1 class="d-inline">Lore of the @tribeName</h1>
<table class="table">
<thead>
<tr>
<th class="col-2">Name</th>
<th class="col-4">Description</th>
<th class="col-2">Year</th>
<th class="col-1">Type</th>
<th class="col-2">Submited By</th>
<th class="col-2"></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventName)
</div>
</td>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventDescription)
</div>
</td>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventYear)
</div>
</td>
<td>
<div class="Event-Rows">
@switch (item.EventType)
{
case 0:
<text>None</text>
break;
//More of the above
}
</div>
</td>
<td>
<div class="Event-Rows">
@Html.DisplayFor(modelItem => item.EventSubmitedBy)
</div>
</td>
<td>
<div class="btn-group d-flex">
<a class="btn btn-danger m-1" asp-action="Delete" asp-route-id="@item.EventId">Delete</a>
<a class="btn btn-dark m-1" asp-action="Details" asp-route-id="@item.EventId">Details</a>
</td>
</tr>
}
</tbody>
</table>
</div>
</body>
16 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
oh okay
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
I got it working! tysm for the help!!
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
I will look into that ty!
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
I sees ty
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
I'm going to guess I do want to. I have very limited knowledge of js, but I at least have some where I know nearly nothing about jq
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
will do. thank you for the help!
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
so what I need to do is send the data with the JS?
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
ah, okay. makes sense
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
I think this should show more or less what I mean
51 replies
CC#
Created by EnderWolf on 12/7/2023 in #help
✅ Nested views failing
it get's saved, and then opens the details view in full screen where my goal is to make it replace the edit view which was inside another view
51 replies