forums.asp.net forums.asp.net

Checkbox validation in modal pre submit with js 2 req on box checked and if other then a comment field is not null

I have a modal form in mvc, using javascript to validate the submission Make sure a least one checkbox in list (see partial is checked)   If the Other box is check then Comment must have an entry The comment textarea is hidden until Other is selected.  So when anything else besides the other box is selected the comment stays hidden and empty and validation should allow the post  When other is selected and comment is empty the...

forums.asp.net forums.asp.net

.Net Core Web API consuming a .Net classic dll using EF 6.4 metadata issue

Good afternoon I have a .net core web api solution that contains a project created in .Net classic FW and uses EF 6.4.  Locally in VS2019 it compiles and works fine.  I test it using Postman and get the result proving I called a web api in .net core that consumed a dll that uses EF6.4.  We use DEVOps to build and deploy and it built using the dotnet publish task after a Nuget restore  <div> <div># DOTNET CLI</div>...

forums.asp.net forums.asp.net

PageModels: Common Code

Visual Studio Code 1.48 | .NET Core 3.1 Hi all In the Pages Folder there are the following .cshtml.cs Files: Books Authors Publishers with the following codes: public class BookModel : PageModel {       private readonly DbContext Context;        public BookModel(DbContext _context)       {             Context = _context;       }        public List<Book> books { get; set; }             public...

forums.asp.net forums.asp.net

Did I take the right approach with this model setup or should I improve it?

Hello.  First off, I apologize for the long post but I really appreciate any help on this.  Just looking for advice on how I setup my models & whether I did this correctly, or if I should improve it?   For the TLDR approach, I'm basically looking for a way to compile everything I'm setting up in my "TelevisitController" (shown below) into a single call, so it can easily be called and setup from anywhere in the...

forums.asp.net forums.asp.net

unhandled exception with ViewData. NullReferenceException: Object reference not set to an instance of an object [.netcore webapp] --

my .NetCore application after successful authentication and token generation, am redirecting user to a 'dashboardhome' page with the auth token in viewdata. In that page, In that page I try to access the viewdata value and write it to my localstorage. with jquery. Error I get - An unhandled exception occurred while processing the request. NullReferenceException: Object reference not set to an instance of an object. Concerned segment...

forums.asp.net forums.asp.net

How to return the same child List with different condition in the same parent?

Hi I'm calling tow partial views of the same model at a parent one, But I want to call every one with a different condition of the other. The parent Model: public class Mobiles { public int Id { get; set; } public string SerialNo { get; set; } public string Notes { get; set; } public IList<MobileRuins> MobileRuins { get; set; } = new List<MobileRuins>(); public...

forums.asp.net forums.asp.net

Code First: InvalidOperationException: Unable to resolve service

Hello, I am new to ASP NET CORE MVC, I chose the code first approach for my project and I followed a tutorial. BddContext.cs: using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Madera.Models; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using MySQL.Data.EntityFrameworkCore; namespace Madera.Context { public class BddContext : DbContext { ...