Date comparison function not work as expected ASP.NET

Advertisements I have created a function in C#, but it did not work as I expected. Today date is 06-10-2023 it should return FeesType 1 but it is returning 2. My code is here using System.Globalization; int value = GetFeesType(); Console.WriteLine("FeesType = {0}", value); int GetFeesType() { int FeesType = 1; DateTime TodayDate = DateTime.Now;… Read More Date comparison function not work as expected ASP.NET

class being a reserved keyword, how to create a property named class inside a class

Advertisements My API Response json has below fields when I paste JSON as classes it created the one of the field as _class as class is a reserved keyword Actual public class Imp { public string Name { get; set; } **public string _class { get; set; }** public Address address { get; set; }… Read More class being a reserved keyword, how to create a property named class inside a class

html: why is my table not 100% of the width?

Advertisements I am trying to show a table that stretches the entire width of the container (which is body) I am trying this: <body> <table class=”table-fullWitdh”> <tr> <td class=”mainHeader table-fullWitdh”> hi </td> </tr> </table> </body> <style type=”text/css”> body { width: 100vh; padding: 0; background: green; } .mainHeader{ height: 150px; background-color:white; } .table-fullWitdh { width: 100%;… Read More html: why is my table not 100% of the width?

How to make a List<> from 2 list of object

Advertisements I have object CartItem and Product. I need to make one List<> from these 2 objects. Tried: List<(CartItem,Product)> product = new List<(CartItem,Product)>(); Code: public async Task<IActionResult> Index() { var username = User.Identity.Name; if (username == null) { return Login(); } var user = _context.Users.FirstOrDefault(x => x.Email == username); List<CartItem> cart = _context.ShoppingCartItems.Where(s => s.IDuser.Equals(user.Id)).ToList();… Read More How to make a List<> from 2 list of object

How could I send the user an e-mail in ASP.NET when there is only 1 day left till an event?

Advertisements So I’m making an appointment scheduler. I want my system to send the user an e-mail when the upcoming event is tomorrow. I’m storing every appointment in an SQL database. I don’t know how to check continuously if the date is within a day instead of only checking it once I load the View… Read More How could I send the user an e-mail in ASP.NET when there is only 1 day left till an event?

Pass a ViewData object when returning JSON in ASP.NET Framework

Advertisements I’m trying to pass a ViewData object from a controller that’s returning JSON data, but unable to access it from the frontend. public ActionResult GLSearchView_Read([DataSourceRequest] DataSourceRequest request, DateTime? d = null, DateTime? d2 = null, int aid = 0) { bool creditMemo = true ViewData["creditMemo"] = creditMemo; var result = Json(GLResearch.Read(aid, d, d2).ToDataSourceResult(request)); result.MaxJsonLength… Read More Pass a ViewData object when returning JSON in ASP.NET Framework