Questions tagged [asp.net-mvc]

The ASP.NET MVC Framework is an open source web application framework and tooling that implements a version of the model-view-controller (MVC) pattern tailored towards web applications and built upon an ASP.NET technology foundation.

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

Unity configured with PerRequestLifetimeManager() creating multiple instances of DbContext per request for WebApi requests, but not MVC requests

Here's my UnityConfig.cs: public class UnityConfig { private static Lazy<IUnityContainer> container = new Lazy<IUnityContainer>(() => { var container = new ...
0
votes
0answers
11 views

How to save an ID from a table to another table in ASP.NET MVC?

I have a problem regarding passing 'slot_id'(auto-inrement primarykey) from 'tb_parkingslots' to 'tb_freeslot' and save it. Here's my code: controller: // GET: Admin/Create public ...
0
votes
0answers
9 views

.NET DocuSign API: Redirect User to docusign envelope to complete form

As part of a new docusign integration, I am trying to figure out how to redirect a user to docusign to fill out and sign/complete a document after creating it. Currently, I am successfuly ...
0
votes
1answer
17 views

How do I call a function in my controller from a button in my .cshtml-page?

I'm trying to create a dashboard/graphical interface for managing purposes. How can I create buttons that call certain functions from a controller? It's in ASP.NET CORE 3, using the MVC-pattern. What ...
0
votes
1answer
11 views

Roles, authorization and permissions in asp.net mvc 5.2.7

What is the standard way of issuing permissions and roles in asp.net mvc? I have creating accounts, saving them and logging in down but have no idea where I create my rules and specify their ...
0
votes
0answers
11 views

@Html.HiddenFor does not pass Value to controller

I am aware there are similar questions. I have read through pretty much all of them (unless someone can prove otherwise). I'm writing a help desk application as a practice project to improve my ...
0
votes
0answers
11 views

How to obtain information on transactions made from the PayPal API?

I develop an application in Asp.Net MVC and I will use PayPal for customers to subscribe and make payments for the products that are offered, I use buttons that redirect customers to the Paypal page ...
0
votes
0answers
23 views

Calling server side event from html button control in ASP.NET MVC

I have an ASP.NET MVC project with a HTML button, <input runat="server" class="btn" value="Sign in" name="" type="submit" onserverclick="btn_OnClick"/> And I put a script tag at the ...
-1
votes
0answers
16 views

ApplicationDbContext and dependency injection problem

I have a problem with ApplicationDbContext, when I use the _context variable to access the database inside the CustomLogger class or in the createLogger method the application crashes and doesn't work....
0
votes
0answers
25 views

view list from two tables

I have below two tables,Product and User Product [PID int (PK),PName nvarchar(50)] User [UID int (PK),Username nvarchar(50),PID (FK),LID (FK),SK nvarchar(100)] UserController has action to ...
0
votes
1answer
16 views

Entity framework generated type in request

How to use entity framework auto generated type like property in post request? If i will send this json, "{"Type":{"CharacteristicId":"test1","CommodityId":"test2"},"ShankType":{"CharacteristicId":"...
3
votes
2answers
40 views

Dapper Querylist return type

My code looks like this; using (IDbConnection cnn = new SqlConnection(GetConnectionString())) { var result = cnn.QuerySingle(sql, parameters); return result; } Its inside a method inside ...
1
vote
2answers
21 views

Show all items for user with admin role

I'm building a help desk application using C# MVC. I have a 'Ticket' view. In my Ticket model I have a 'RaisedBy' property. I have been able to apply some logic to show a logged in user their tickets. ...
0
votes
0answers
10 views

Cannot resolve scoped service 'Webservice.Services.ISeedDataService' from root provider [duplicate]

I'm trying to create some data in asp.net core with seeddata method throw web service. First I added my service to sevice collections throw startup ConfigureServices method: public void ...
0
votes
0answers
7 views

mvc when using captcha when i refresh second captcha first captcha is refreshing

Here im using two captcha when i refresh 2nd captcha 1st captcha is refresing Please Help me <div id="div1"> @Html.Captcha(4)<br /> </div> <...
0
votes
2answers
32 views

Display Sql Function to a list

Hi, I have a function which return a table and i wanted to display this table in a list - note: the function is executed successfully. My Function ALTER function [dbo].[VLOUL] ( ...
0
votes
0answers
9 views

Queue Background Work Item not woking in iis classic pipeline mode

In one of my asp.net web application, i need to use QueueBackgroundWorkItem for some reasons. When i set iis app pool to integrated pipepline mode, the QueueBackgroundWorkItem job works correctly, but ...
0
votes
0answers
12 views

Error Failed to decrypt using provider 'rsaprotectedconfigurationprovider'

I have to do update APS.Net MVC System someones did long time ago. there is a problem to run page while debugging web.config file section called appSecureSection. that developer leave the company ...
0
votes
1answer
22 views

Strange behavior of esc button when pressed

I have an application which is currently hosted on http://173.46.150.58/ . It is developed in ASP.net core MVC. On any page when i click esc button it adds "/config/?frameUrl=" into URL due to which ...
0
votes
0answers
20 views

Probem with Tabstrip LoadContentFrom

Getting kendo.all.min.js:40 SyntaxError: Unexpected token '<' tried to use ToHtmlString() as well but this just render the grid in html tags and not showing the data <script id="RowsTemplate" ...
0
votes
1answer
22 views

How can I validate an account with a stored procedure that uses hash encryption, C#, ASP.NET MVC, Entity Framework

So basically I have a stored procedure which is able to decrypt the password and return 1 if user exists. Here is the code: CREATE PROCEDURE [dbo].[ValidateAccount] @Username VARCHAR(50), ...
-1
votes
0answers
36 views

C# List Object display and filter input dotnet mvc

I have been trying to do this for a while and need some help badly. I installed the new visual studio on my mac as well as dotnet mvc. I have created a simple app and I can't figure this out at all. I ...
0
votes
0answers
13 views

Handling cookies based on route in a single request lifecycle in ASP.NET MVC?

I'm writing a route that will allow the user to set a cookie with the version of some JSON object that the application will use to set client-side configurations. It is a fairly large JSON object that ...
0
votes
1answer
24 views

How to use “readonly = true attribute on @Html.TextBoxFor”

I'm working on a simple helpdesk application to improve my C# skills The problem: I want to pass the current logged in user back to be stored in the database. Here is what I have so far: <div ...
-2
votes
3answers
44 views

Issues accessing an array in JSON response

I'm trying to access an array in a JSON response and receiving the following error: JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System....
0
votes
1answer
30 views

Custom Validation Attribute that Prohibits Input of a list of invalid characters in textbox

I am a college student working with Asp.net MVC, I need to get a custom validation working that prevents input of specific characters e.g @#$%*, etc for a specific field. I know custom validations are ...
-1
votes
1answer
28 views

AuthorizeAttribute doesn't work when refresh the page

I have some problem with authorization: The AuthorizeWebForm codes work when loading the page, I am not in the admin group so I don't have the access, which is great. But when I refresh the page, I ...
0
votes
1answer
14 views

Prevent output cache when the result is null

In my project I use the OutputCache attribute so my web server doesn't have to keep downloading the same files, but rarely there are some issues where for unknown reasons it returns null. So If the ...
0
votes
1answer
20 views

how to insert buttons in datatable row?

I have now the code to get the list of objects that I will use to fill datatable, but I want to add a buton in each row. How to do that ? var hCols = []; model = @Html.Raw(Json.Encode(ViewBag....
0
votes
0answers
13 views

Needed changes when migrating a Classic Asp.net project to a Asp.Net MVC

I'm trying to migrate an old project written in Classic Asp.net to Asp.net MVC ,and I'm havingg quite difficulties trying to move the files in the MVC project, like these: Where to put the App_Code_ ...
0
votes
1answer
17 views

How to get list items in response from ajax.request jquery

I am working on Asp.net MVC application which has function with a jQuery ajax call as below. I am getting a response as expected in data/result object. It has multiple items in array. How can check ...
0
votes
0answers
6 views

Abp returnUrlHash being lost on iOS device

My single page asp.net mvc application has a redirect. The redirect works as a charm but the issue I am coming across is anything after the hashtag fragment gets lost only on iOS browser. Login....
0
votes
0answers
37 views

My partial view does not refresh after AJAX call

I am having an issue not able to refresh my Partial view. my cshtml page page <script type="text/javascript"> $(document).ready(function () { $('#btncreate').click(function () { ...
0
votes
1answer
46 views

Asp.Net core 3.0 The path in 'value' must start with '/'

I couldn't find the call stack for this problem, looks like everything is fine with the controller, but it has a problem with the "asp-href-include". Here is the exception: ArgumentException: The ...
0
votes
0answers
6 views

MVC Core Select Helper Tag filtering

Is there any way to filter the results from a MVC Core Select Tag helper? I have a list of Names populated, but there are so many that it is not easy to scroll through them all, so was wondering if it'...
0
votes
1answer
17 views

ajax request asp.net mvc pass id value from ajax request to controller

<h2>GetAllProducts</h2> <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.Genre) </th> <th> @Html....
-1
votes
0answers
31 views

How to post a bool value in httpclient

How to post a bool value in multipart/form-Data while calling httpclient.postasync() content.Add(new StringContent(myboolValue), "IsEdited"); Similar to StringContent is there anyway to pass a bool ...
-3
votes
1answer
17 views

Live Search Data In asp.net MVC with AJAX and Jquery [on hold]

I want to add live search features in my asp.net MVC page. I have Product category table in my database with category name and category image. And i have displayed all this record in a view form ...
0
votes
2answers
34 views

How to get sessionStorage(client side) value in controller or model or view(before body render) MVC

what I would like to do is when the first time app will load I will store Menu in client-side sessionStorage and next time any page load get menu from sessionStorage My website flow is LoginPage > ...
0
votes
1answer
17 views

Passing iterative data from button to modal in razor

I have a razor view page where I loop through my list and render it on a table row by row. At each row, there is a button to send the informations stored in the spesific row via mail but the button is ...
0
votes
1answer
30 views

How to prevent the Bootstrap Modal from auto closing?

I have bootstrap modal (opened by button) in "Index" View in my ASP.NET MVC web app. In this modal I call stored procedure (with input parameter) which fill three texboxes. After that my modal closes ...
2
votes
0answers
32 views

How to validate items in Dictionary<string, T> view model property using FluentValidation

I am using a Dictionary<string, T> data structure to store phone numbers in a view model. The user can add or remove them client side before posting them back to the server. Back story: I am ...
0
votes
0answers
18 views

Request.IsAuthenticated property is returning false with openId Connect

I am integrating Azure AD in my MVC application using openID connect, i follow the steps mentioned in https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-v2-aspnet-webapp ...
0
votes
0answers
25 views

Multi-language website in ASP.NET with resources? [on hold]

I'm currently creating a website, I want to add languages (french, English), I created the App_Global Resources's folder inserted the two resources files Resources .fr.resx & Resources.resx, I ...
-3
votes
0answers
29 views

c# mvc How to count How many User Visit Particular Page

Here i Wrote How many User Visit WebSite As protected void Session_Start() { Application.Lock(); Application["Totaluser"] = (int)Application["Totaluser"] + 1; ...
0
votes
0answers
25 views

Azure DevOps Pipelines setup for onsite servers

Hello fellow developers I have run into a problem (surprise, eh?). In our company we are in the process of switching our GitHub repos to Micrsoft Azure since we have bought licenses for MSDN, ...
0
votes
0answers
13 views

ASP.NET MVC Core2.2 Bootstrap Radio Button state

I'm fighting with a simple problem: I need to get a state of a button (which acts as a radio-button). The buttons look like this 1: I use scripting to change the state of the buttons (by changing the ...
0
votes
0answers
10 views

Startup Project keeps reverting to IIS Express for debugging

In my solution I basically have two projects, the one I'm coding on, and the startup project, Startup.csproj. I have Startup.csproj configured to use Local IIS for debugging, and I normally just ...
0
votes
0answers
18 views

StreamWriter get stuck on Write. Process.StandardInput, Wkhtmltopdf

I have wkhtmltopdf program that converts HTML content to PDF file. It is working for most of all my content, but can hung up on StreamWriter.Write(html); for some of them. I get content as bytes ...
0
votes
0answers
9 views

How to convert PPT and Docx File to PDF Using C#

I have a project in which there are multiple office files Like Docx, PPT, PPTX, So when user upload a file I want to load and show a file in the web browser now the problem is that how to show ppt and ...