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.

1
vote
0answers
12 views

Aspnet Core MVC application with spotify authentication callback url redirecting to 127.0.0.1

I'm building an aspnet core web application and want to allow my users to authenticate using their Spotify accounts. I've managed to get the auth flow working as expected when running locally but when ...
-5
votes
0answers
17 views

While calling controller actionResult from another function its raise any new n/w post?

I am calling Controller ActionResult function from another c# function, while calling its raise any N/W post? it's may fetch different server. that's why asking,
0
votes
0answers
12 views

How to optimize speed of query EF

i've a query as well as: var query = unitOfWork.Ticket_Repository .FindByQueryAsNoTracking(e => e.BusinessPageId == bpid && e.Status != p2 && e.Status != p3) ...
0
votes
0answers
14 views

Ajax call stops abrupt and goes to Http Post instead

I have a form, where throught templates the html is replaced when the user clicks a button and fills in parts of the form (I do it this way to guide the user in what he fills in first). the problem is ...
0
votes
0answers
7 views

Error Object Reference Not found when Record does not found using Linq to Entity my Query attached

i am trying to get one column value using linq to entity. If record does not found it must be null. my code is, string SeqNum = Db.Visits .Where(v => v.Status == 5 && ...
0
votes
1answer
13 views

How to make multiple regular expresions in .net mvc model?

I have a model propery that i want a regex with either of 2 conditions. [RegularExpression(@"^\(?([5]{1})\)?[-. ]?([0-9]{2})[-. ]?([0-9]{3})[-. ]?([0-9]{4})$" [RegularExpression(@"^\(?([6]{1})\)?[-. ...
-1
votes
0answers
32 views

How to implement paypal in web api [on hold]

I want to implement PayPal payment gateway integration in which I want to perform split payment between 1. Paypal Admin 2. Paypal user Payment will be made from credit card. I have tried PayPal ...
0
votes
0answers
6 views

How to add support for HTTP/1.1 and HTTP/2 in .Net MVC and API

I am hosting my .Net MVC app on windows server 2016. Currently HTTP/2 is by default enabled on windows server 2016 due to which due to which i am getting Authorization error with error code 401 on ...
-3
votes
0answers
28 views

SignalR is very weird and not working from time to time

The project uses Angular-7 & .NET Core Rest services for backend. The client side could be considered as 2 dashboards and each dashboard contains multiple angular components. I want to display ...
0
votes
1answer
45 views

How can i implement an ASP.NT MVC Controller?

I am new to .NET FRAMEWORK, and am trying to come up with an ASP.NET MVC API for a real estate. In my database, I have a table Product and Amenity. My assumption is a Product e.g Apartment can have ...
0
votes
0answers
22 views

Why is 32 bit machine.config is being used, when my windows is 64 bit?

My ASP.NET MVC project is reading machine.config from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config But why? I would expect it to use Framework64, because I am using a 64-bit ...
0
votes
1answer
31 views

failed to load resource: the server response with a status 500 (internal server error)

i had build a web form with autocomplete method, the program is working fine in IDE. But after i publish the application to IIS, the method is not working. the console show this error `failed to load ...
-1
votes
0answers
27 views

Session object in MVC controller

What is the difference between HttpContext.Session and Session in an MVC controller? I have noticed that sometimes the Session['aKey'] is null even if it is assigned and never changes.
0
votes
0answers
27 views

ASP.NET CORE validate is not a function - manual validate trigger [duplicate]

I have a simple asp.net core app generated from asp.net core MVC template. Scaffolded some controllers and views and I was good to go. I have tested validation with jquery validate unobtrusive. When ...
-1
votes
0answers
10 views

how to include javascript code in my view? [on hold]

i have this code @foreach (var item in Model) { <td> @Html.DisplayFor(modelItem => item.username) </td> <td> @Html....
0
votes
0answers
36 views

Is there a way to call MVC Controller from Angular Typescript without using Ajax?

I'm planning to develop an web application wherein there's an WYSIWYG text editor which you can save to database and export the output into DOCX/MS WORD. I could only find word automation/export on c#,...
0
votes
0answers
18 views

Automapper - ignore property that exist only in ViewModel

I am trying to map Model ViewModel, using Automapper 8.1, but it does not work because I have property in ViewModel that I dont have in my Model, I am getting "unmapped member" exception Model: ...
0
votes
1answer
13 views

Jump/Reload to same page from Ajax success function on razor view in MVC

Here is my Ajax call, I am calling an API that updates the database and I want page to be reloaded on success function. $("#Pendingbookings").on("click", ".AcceptBooking", function () { ...
3
votes
3answers
33 views

parameter not send in ajax request

I want to call the action method(AddCompare) using an Ajax request at the View, My problem is that the parameter sent to AddCompare Action always has zero value, While the parameter value in the ...
0
votes
0answers
11 views

How to use loopback IP to retrieve auth token

Recently Google banned embedded browser auth in favor of Loopback IP approach My site has a desktop client that uses the same login system as the web site. Basically I pop a embedded browser view to ...
0
votes
0answers
21 views

Unobtrusive validation doesn't fire on radio buttons

I'm trying to get a form to validate in JavaScript using the included jQuery.Validate. Text and select inputs validate correctly in JavaScript, but any radio button groups I include in the form only ...
0
votes
1answer
29 views

Unable to set RequestUri of HttpResponseMessage in Web Api Controller

I am calling 2 APIs (one orignal and other mock) using HttpClient. So if the URL of the API call is https://something.com/abc/xyz, when I POST to this url in the response the RequestMessage....
0
votes
1answer
23 views

Posting data by XMLHttpReques does not return json value

I post data by XMLHttpRequest to controller. I pass only string with value "1". When I check request with fiddler everything is ok. There is JSON rara=1. Request connect to method in controller, but ...
0
votes
1answer
19 views

I have a JS function that should change the innerHTML of a td based off of an event change in a DropDownListFor, but only works on initial load

I have a JS function that should be changing the innerHTML of a TD based off of the value of a DropDownListFor. It works on the intial load, but does not work when the drop down list is changed again. ...
0
votes
1answer
18 views

How to set timer of 5 min to do certain operation in app and if timeouts, raise another event to do other task

I am developing airlines reservation app. Here, user selects flight and logs in. After login 5 min time is to be provided to him to complete his reservation, payment and confirm ticket. If his task is ...
0
votes
1answer
22 views

ASP.NET MVC ToString error when converting a DateTime to a month number

I am confused with the error I am getting. I am trying to return records that have the Month number equal to i but I recieve the following error. No overload for method 'ToString' takes 1 ...
0
votes
0answers
17 views

Is there a way to, when pressing Enter key, save the data directly on database using slickgrid?

Im trying the slickgrid plugin ! I can red, edit and add data on the db when I press the "save" button. However, I was trying to do the same as excel, where you press the Enter key and it updates on ...
0
votes
0answers
16 views

Google Calendar API: Credential property is always null

I recently tried following this guide : https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web_applications After I log in, the Credential property is still null and it ...
-4
votes
0answers
15 views

Macro for creating database [on hold]

I want to write a macro that will send my table in Excel to the server and create a database automatically. For example, this is my Excel: Arry Excel A1 A2 A3 name Column Shahin ...
1
vote
0answers
18 views

How to post file and other information to controller and save it in sql server?

I am working on an mvc project in which I need create a form in which I have to take "Name", "age" and an excel sheet. For that I created a table as: create table pinfo( sno constraint pk primary key,...
0
votes
1answer
16 views

Grid System in bootstrap MVC

I get some issues in the grid system. I design this label and text box but I want all this together. How can I do that ? I tried but it is not come with me enter image description here This is my ...
-2
votes
0answers
13 views

Is there any demo how to draw a custom route on google map like cycling route or racing route

I go through one website https://loeberute.dk/Map/Create and after saved its beautifully showing whole route. How to make this type of facility for my website? Any help would be appreciated, Ronak ...
0
votes
0answers
20 views

Why connection.hub.start() working but client.all.notify not working?

Why connection.hub.start() working but client.all.notify not working ? my script // signalr js code for start hub and send receive notification var notificationHub = $.connection.notificationHub; ...
-1
votes
1answer
37 views

How to remove only one validation attribute before checking ModelState.IsValid on server side?

I have below model class. that is shared by multiple views. Now, For the view1.cshtml both validation attribute(i.e RegularExpression,Required) working fine so I don't need to do anything for that. ...
0
votes
0answers
64 views

After Page refresh Model items lost C# MVC

I have a below code and the problem is when i add item first time,then i add Id to the Model.Again i click the same button to edit something my models Id is null.It lost i have already assigned Id ...
0
votes
1answer
18 views

How to open a modal using Kendo UI grid that has a list inside it

I am using Kendo UI in my asp.net mvc project. I have an issue for displaying modal. In my grid, I want to add an extra column that has a button in it. When the user clicks that button, I need to ...
1
vote
0answers
28 views

Why does Html.PassowordFor print a placeholder as gibberish?

I have a view where I have a Html.PasswordFor helper if the property which is linked to the helper has a value I set the following placeholder: placeholder ="•••••••••••••••••" However, the ...
0
votes
2answers
83 views

My foreach statement is outputting 2 errors

When I try to output a table with a foreach statement, it outputs 2 errors saying that the MovieViewModel and the MovieVM dont exist. This is part of the Index.cshtml file: @foreach (...
0
votes
0answers
21 views

Is there a method where I can find which column data has been inserted with wrong data type

I have written this code but want a Try-Catch where I can find that which row and column the data has been entered with different data type for (int row = 2; row <= range.Rows.Count; row++) ...
0
votes
1answer
36 views

How to display the details of a row from multiple tables using LINQ?

I'm stuck here on a situation wherein I should display the details of a person together with the list of his/her allocations. I've done creating a view model to pass the data to a view but the result ...
0
votes
0answers
34 views

How to keep multiple database info on mvc project

I have a Saas (sofware as a service) project for dentist. Each dentist will have its own database. When dentist is login should connect to its own database. But I dont have any idea about how can i do ...
0
votes
1answer
42 views

Get value from JsonResult response in another controller

I need get value from jsonresult response from controller to another controller public ActionResult ToDo(){ ... return Json(new { result ="success" }, JsonRequestBehavior.AllowGet); } public ...
0
votes
1answer
16 views

Bind Asp.Net SelectList to parameter

I have an object Individual Action which contains a Quarter Attribute and an enum public int QuarterId { get; set; } public QuarterList Quarter { get; set; } public enum ...
4
votes
3answers
57 views

Angular2+ C# Web Api - Server side save datetime with wrong time

I'm trying to save a datetime, but when the webapi receives the date, it changes it to an incorrect time zone. My angular app return: Wed May 22 2019 11:03:35 GMT+0200 But my Web Api return: 22/05/...
-2
votes
0answers
27 views

Jquery autocomple suggestion is not displaying under textbox in mvc

I use jquery autocomplete textbox, but it's not showing the suggestion instead of js is working. jQuery("#txt-search").autocomplete({ minLength: 2, delay: 500, source: function (request, ...
0
votes
4answers
54 views

How to put variables into an object inside a list

So I'm creating a table to output the values of my database's data. During the process, I was able to output, but only the first record. Then I searched for it and noticed that I had to do a list to ...
0
votes
1answer
26 views

Html5 audio dynamic source is null, how to detect it?

I have HTML5 audio element and source of it is pointed not at mp3 file directly, but at action in controller, which returns or mp3 file (FileResult) or null. Getting result takes a while (1 min), so I ...
0
votes
3answers
69 views

How to convert string to Newtonsoft.Json.Linq.JObject

Im still newbie and learning some API calls. Just dont know why code dont convert from string to Newtonsoft.Json.Linq.JObject. WebRequest request = WebRequest.Create("https://api.pandascore.co/lol/...
0
votes
1answer
32 views

How to redirect to main log in page when a session expires in Asp.net?

I have developed an application in Asp.Net MVC with C# Programming Language and using code first Approach, The application is deployed and everything is working properly except a minor issue that i am ...
-1
votes
1answer
30 views

How to display values from multiple models using ViewModel?

I need one table in View that contains data from my ViewModel which contains references to two models. So: I have StudentModel, ClassModel and a StudentClassViewModel. What should I do in ...

http://mssss.yulina-kosm.ru