C
C#10mo ago
Salight

Why is this exception occuring what am i have to do ?

No description
6 Replies
i like chatgpt
i like chatgpt10mo ago
$code
MODiX
MODiX10mo ago
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/
phaseshift
phaseshift10mo ago
(people like code, not screenshots). I'm not a front end guy so not sure what's up.
Salight
SalightOP10mo ago
//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>

Ahsan_Naqvi
Ahsan_Naqvi10mo ago
It seems the Modal is null
Salight
SalightOP10mo ago
//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; }
}
}
in here i am assigning the model variables how is null then doesn't that counts backend
Want results from more Discord servers?
Add your server