All Questions
65
questions
-1
votes
1
answer
40
views
In .net core I want to get API through the two tables
In .Net core I have two tables with Buyer,
and the relation table as RicePrice:
public class Buyer
{
[Key]
public int Id { get; set; }
public int Quantity { get; set; ...
0
votes
1
answer
37
views
How to pass IHttpContextAccessor as parameter to ValidationClass' Method
I have a class for Validation which is:
public class PageValidation:ValidationAttribute
{
private readonly string UserKey;
private readonly HttpContext _context;
public PageValidation(...
0
votes
1
answer
285
views
How do I clear cookies with different domains?
I am developing a .net core mvc web application with the same site cookies. And I would like to clear all cookies after the user logged out. Please refer to the image:
I have tried like this:
foreach ...
0
votes
3
answers
86
views
RedirectToAction not doing anything
I have this method which should redirect to the Index method of the same controller. This method is called using ajax.
public IActionResult ActualizarJornada(string data)
{
...
0
votes
1
answer
631
views
Unicode character (\u0022) is showing backslash with double prime
Trying to handle this string 8202D-Ti-36" (This is "e; HTML entity for inch/double quote) to #8202D-Ti-36" using replace function in C# Replace(""", "\...
1
vote
2
answers
53
views
i am no able to perform add-migration in
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using _Istudnet.Helper;
namespace _Istudnet.Models
{
public class Student
{
[Key]
...
0
votes
0
answers
69
views
ASP.NET Core 6 MVC - Model doesn't binds
Making a few test with Core 6 - MVC.
Can't figure out why while this works:
[HttpPost]
public IActionResult Create(IFormCollection collection)
but when i used the view model, for some reason, ...
0
votes
1
answer
567
views
How to Select Date Time with Month and Year Only .Net
I want to make user select date time month and year only. Even though i added bootstrap's datepicker i couldnt success.
Here is my java script code in another file.
$(document).ready(function () {
$(&...
0
votes
1
answer
157
views
get news list by category id .net core
We have 3 models Category, Post and PostCategory. I want get news list by category id using generic repositor pattern so how to implement it.
public class Category
{
public int Id { get; ...
1
vote
1
answer
346
views
How to Pass Jsonstringfy object with other parameters
I want pass more parameter with json stringify() but when passing other variable getting null value. please let me know right way of passing more variable .
I have tried this
data: {model:JSON....
-1
votes
1
answer
71
views
How can i use different status page in MVC .net core
My system has a website, a dashboard with an one admin.Users are redirected to statuspage during the visit in the same way as the admin, but I want the admin and users to see different pages
I am ...
1
vote
2
answers
92
views
I am unable to get the values from a form from cshtml page to my controller
I am getting null values in my controller after the form is submitted to the code
<form action="Home/Book" method="Post">
<input type="text" id="Name&...
0
votes
1
answer
4k
views
Unable to add .NET project reference in VS 2019 or 2022
I'm trying to add a project ref to my main solution but unable to do so.
I tried: Manually adding it from references option but the dll was not found.
Changed the target version as well but no effect. ...
3
votes
1
answer
738
views
In ASP.net core, How to Reload the _layout page when retun view()
I want to refresh the _layout page for updating data in the layout section, when a action method returns a view().
Currently when I am returning the View(), layout page data are not updating.
1
vote
1
answer
646
views
Is there an attribute I can use in net core 6 to restrict my controller to only allow calls which come from a certain paths?
For example I have a class:
public class AccountsController : Controller
{
[HttpPost, Route("LogIn")]
public LogIn([FromBody] request)
{
//log in
}
[HttpPost, Route("LogOut")]
...