6 Replies
$code
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
For longer snippets, use: https://paste.mod.gg/(people like code, not screenshots).
I'm not a front end guy so not sure what's up.
//index.cshtml
@page
@model MeetingInfo
@{
ViewBag.Title = "Toplantı Başvuru ";
Layout = "_layout2";
}
<h1 class="h4">@ViewBag.Selamlama</h1>
<p>Toplantı Katılım Durumunuzu bildiriniz
</p>
<div class="card my-2">
<ul class="list-group list-group-flush">
<li class="list-group-item">@Model.Location </li>
<li class="list-group-item">@Model.Date.ToString("dd/MM/yyyy HH:mm:ss") </li>
<li class="list-group-item">@Model.NumberOfPeople </li>
</ul>
</div>
<a class="btn btn-sm btn-outline-primary" asp-controller="Meeting" asp-action="Apply">Başvuru yap</a>
//index.cshtml
@page
@model MeetingInfo
@{
ViewBag.Title = "Toplantı Başvuru ";
Layout = "_layout2";
}
<h1 class="h4">@ViewBag.Selamlama</h1>
<p>Toplantı Katılım Durumunuzu bildiriniz
</p>
<div class="card my-2">
<ul class="list-group list-group-flush">
<li class="list-group-item">@Model.Location </li>
<li class="list-group-item">@Model.Date.ToString("dd/MM/yyyy HH:mm:ss") </li>
<li class="list-group-item">@Model.NumberOfPeople </li>
</ul>
</div>
<a class="btn btn-sm btn-outline-primary" asp-controller="Meeting" asp-action="Apply">Başvuru yap</a>
It seems the Modal is null
//HomeController
using MeetingApp.Models;
using Microsoft.AspNetCore.Mvc;
namespace MeetingApp.Controllers
{
public class HomeController:Controller
{
//localhost/home
public IActionResult Index()
{
int saat = DateTime.Now.Hour;
ViewBag.Selamlama = saat > 12 ? "İyi günler" : "Günaydın";
//ViewData["Selamlama"] = saat > 12 ? "İyi günler" : "Günaydın";
var meetingInfo=new MeetingInfo()
{
Id = 1,
Location="İstanbul,Abc kongre Merkezi",
Date=new DateTime(2024,01,20,20,0,0),
NumberOfPeople=100
};
var info = new MeetingInfo();
info.Id = 2;
info.Location = "Wow";
info.Date = new DateTime(2024,01,20,20,0,0);
info.NumberOfPeople = 100;
return View(info);
}
}
}
//HomeController
using MeetingApp.Models;
using Microsoft.AspNetCore.Mvc;
namespace MeetingApp.Controllers
{
public class HomeController:Controller
{
//localhost/home
public IActionResult Index()
{
int saat = DateTime.Now.Hour;
ViewBag.Selamlama = saat > 12 ? "İyi günler" : "Günaydın";
//ViewData["Selamlama"] = saat > 12 ? "İyi günler" : "Günaydın";
var meetingInfo=new MeetingInfo()
{
Id = 1,
Location="İstanbul,Abc kongre Merkezi",
Date=new DateTime(2024,01,20,20,0,0),
NumberOfPeople=100
};
var info = new MeetingInfo();
info.Id = 2;
info.Location = "Wow";
info.Date = new DateTime(2024,01,20,20,0,0);
info.NumberOfPeople = 100;
return View(info);
}
}
}
//model
namespace MeetingApp.Models
{
public class MeetingInfo
{
public int Id { get; set; }
public string? Location { get; set; }
public DateTime Date { get; set; }
public int NumberOfPeople { get; set; }
}
}
//model
namespace MeetingApp.Models
{
public class MeetingInfo
{
public int Id { get; set; }
public string? Location { get; set; }
public DateTime Date { get; set; }
public int NumberOfPeople { get; set; }
}
}