Questions tagged [asp.net-mvc-5]
ASP.NET MVC 5 is the fifth major version of the ASP.NET Model-View-Controller platform for web applications.
15,597
questions
0
votes
0
answers
12
views
Confirmation Dialog from MVC controller
I want to read excel and count number of rows in excel and show user message to confirm number of rows to upload. I was just looking for help how to show message from controller after reading excel ...
0
votes
0
answers
38
views
unable to send an email after deployment of website using asp.net mvc 5
I am trying to send an email using asp.net MVC 5 I use the number of repositories for email it's working on local but after deployment, it's not working where I am wrong??
and
Less secure app access ...
0
votes
1
answer
16
views
ampersand symbol in url param, after encoding also throwing an error - MVC
In one of my action methods , I do have a parameter "filename", which some times can be a string with ampersand symbol.
The problem is when ever we have an ampersand symbol its not hitting ...
-2
votes
0
answers
14
views
how can i display a sql server log only when the form is submitted with ASP.NET MVC [closed]
I would like to be able to show a record that I have in my sql server database but I want it to only appear if they submit the form that adds the record, but I can't, if anyone can help I would really ...
0
votes
1
answer
26
views
User.Identity.IsAuthenticated is false when I try to access through IP address
I published web site to IIS on Windows 10. If I try login to website through forms by url http://localhost, I can access to system. But If I try login by url http://10.0.0.101 , then after login User....
0
votes
0
answers
9
views
Update 2nd Model from Single Controller Action
I have two SQL Tables: ICS_Header and ICS_Orders. These two tables make up The Who (Header) and What they ordered (Orders).
Users add items to their order, by selecting the items (on the Create ...
-1
votes
0
answers
15
views
ASP.NET MVC5 Re-use data in a model after passing to View
In my project I need to get a list of data from a db (let's say it's a list of names and addresses) and display to the user to review before processing further.
I get the data and add to a List in the ...
0
votes
0
answers
18
views
How to convert MVC5 project to SDK style
I have an MVC 5 web project (referencing Microsoft.AspNet.Mvc (5.2.8) and Microsoft.AspNet.WebApi.WebHost (5.2.8)) and I would like to convert the project file to SDK style.
I know this is not ...
1
vote
1
answer
47
views
Get base URL of webapi
(typing from mobile)
I got a webapi with an action based http controller.
So there are no web pages just API.
vsstudio generates localhost:port URLs when deployed localhost.
I wonder how to get the ...
0
votes
0
answers
16
views
ASP.NET MVC and DataTables, cannot redirect to custom error page
I have a problem when combining ASP.NET custom errors and use DataTables in a view.
If DataTables tries to get data from the server and an error occurs, first, the error is caught by ASP.NET MVC in ...
0
votes
1
answer
78
views
IDX10501: Signature validation failed. Unable to match key: kid
We want to switch our web apps to using Azure AD for authentication.
I'm using the example at: https://github.com/Azure-Samples/ms-identity-aspnet-webapp-openidconnect
It wouldn't work initially but ...
0
votes
1
answer
51
views
Destination array was not long enough in mvc
I am trying to store an image in the database.
Here is my code
Create.cshtml view:
@using (Html.BeginForm("Create", "Home", FormMethod.Post,new { @class = "form-horizontal&...
0
votes
0
answers
59
views
Resolve Dependencies by a IWindsorContainer and a ILifetimeScope instance in Castle.Windsor 4.x
I have a (root-) IWindsorContainer / IKernel instance and a ILifetimeScope Instance.
How do I resolve dependencies from the IWindsorContainer/IKernel for the ILifetimeScope -instance manually (using ...
0
votes
0
answers
13
views
Dynamic Textbox Count total for Invoice
Can anyone please suggest some links so I can perform the total count task?
I am dynamically generating the textbox when Admin clicks on the Add New Row.
<tr>
<th style=&...
0
votes
1
answer
36
views
How place where condition in LINQ
I am fetching the data based on ID from multiple tables. Here is my code.
public async Task<IActionResult> GeneratePDF(string uniqID)
{
//Other code
List<MasterDetails> MasterData = await ...
0
votes
1
answer
29
views
Why images paths not store in database MVC5?
I'm new to MVC so I hope to get help regarding my question. I am making users upload images. the image path will store in the database but the image itself will store in the Content folder. The code ...
-2
votes
0
answers
34
views
Html video player only supports h264 codec, I want to run all the videos in my project.How can i implement the logic in controller,view in mvc5 .net?
In my view some videos are showing but some are not because codec is different for some videos? How can I implement the logic for showing all videos in my page?
0
votes
0
answers
18
views
How to keep values in all views in ASP.NET MVC 5
I want to have some information in all the views. I did this with cookies,But after a while, the values is deleted from the page. my code in controller
Response.Cookies["Cookies"]["Name&...
0
votes
0
answers
49
views
How to redact username password details on client browser when building MVC 5 application
I have built an MVC application and I am using its standard authentication code generated by the template. The configuration looks like:
public void ConfigureAuth(IAppBuilder app)
{
...
0
votes
0
answers
10
views
How to get the object instance in IMetadataAware.OnMetadataCreated
I need to use DisplayAttribute to display a different text in a form of the view, depending on some condition. That condition uses other property of the model.
For instance, in this HTML helper:
@Html....
0
votes
0
answers
33
views
How to stop ASP.NET MVC from interfering with Angular routing?
I am trying to get Angular to work with ASP.NET MVC by following this tutorial. So far, after a lot of trial & error I was able to get it to work for the most part. However, the ASP.NET MVC ...
0
votes
1
answer
54
views
Change environment variable RUN TIME
How can I change the environment variable RUN TIME?
Using Login PAGE I am selecting Development or Production.
Based on that I have to use my ConnectionString device specifically.
"...
0
votes
0
answers
27
views
Retrieve connection string based on Dropdown value
I am developing a web app using DOT NET Core dapper. Till now I have only one connection string for my database but now I have a new requirement in which when ADMIN runs the login page and from ...
1
vote
1
answer
22
views
How do I make a read only view for all view tabs in one detail page?
I am brand new to this I have a website in which I have a Projectcontroller an three views in it and I want to show all of the view pages details into one detail page so when try to click & see ...
2
votes
2
answers
171
views
Token doesn't get refreshed when sending request with Ajax
I'm using IdentityServer4 as a centralized auth server. I have a mvc app that acts as a client and works as expected unless I open a modal. When the user presses the edit button,I load the data into ...
0
votes
0
answers
81
views
How to redirect to custom 403 using Middleware - asp.net
I'm trying to redirect if authentication fails to a custom 403 page which Is not working.
The web pages should only be accessible if the user is authenticated via LDAP(should belong to a particular ...
0
votes
1
answer
30
views
Displaying an iframe with @Html.Raw is not working like when displaying Script with @Html.Raw
Note: This is written in asp.net mvc 5. That is the tech I am using for this.
I am used to displaying certain data when I use @Html.Raw to show data from a Model on the front end of my site for ...
0
votes
0
answers
27
views
Google Oauth2 API using DotNetOpenAuth in asp.net MVC5 giving 401 Unauthorized
Google Auth2 Not working for organizational email. Although it was working fine, but on a sudden it stopped working and saying 401 unauthorized.
[AllowAnonymous]
public async Task<...
0
votes
1
answer
30
views
Stop timer if DIV value changed based on ActionResult Value
I am uploading files into the folder as well as saving their details into DB. While performing this task I am starting my timer And after inserting data I am interested to STOP the timer.
<div id=&...
0
votes
0
answers
30
views
MVC 5 Prevent Users From Going Back After Logging In or Out Using Identity Framework
I am building an app using MVC 5 and I ran into a common issue that has been asked over and over but I can't seem to find the right answer using .NET Identity. Once the user logs in, they should not ...
0
votes
0
answers
23
views
Receiving parameter null in the controller when passing values from a form in the view
I have a form in the Home index page that ask the user which patient wants to see, and ask for the SSN (Social Security Number) number that is a foreign key in the table DIAGNOSIS. When the user enter ...
0
votes
0
answers
23
views
ASP.NET Reload (Redirect) view without changing the back button order for chrome
Can I somehow redirect or reload the page without an entry in the back button queue (or history.back() in JS)?
Currently, I'm using "RedirectToAction()" as the return value for a Post to ...
0
votes
1
answer
27
views
I'm trying to make a label [Required] only if the condition above is true
I'm trying to make a Register page and i want to require Job details(Company name, Position, etc) part if the user is actively working. But couldn't find the solution
0
votes
0
answers
27
views
Best way to handle a many to many relationship in EF6 ASP.NET MVC 5 and retrieve property from navigation property to list
A few years ago I took over a project from a previous developer and have been working my way through this system and adding to it as well as reconfiguring some aspects of it. The latest thing I've ...
0
votes
0
answers
27
views
Update UI Based on execution time in DOT NET CORE MVC
I have one method which is called when I click on the button.
[HttpPost]
public async Task<bool> btnClickAsync([FromBody] OBJ_DETAILS)
{
...
IList<string> Urls = await ...
0
votes
0
answers
19
views
Table Keeps Appearing Empty When I Start App MVC 5 Identity
Good Evening,
I used this tutorial https://docs.microsoft.com/en-us/aspnet/identity/overview/getting-started/aspnet-identity-using-mysql-storage-with-an-entityframework-mysql-provider
and if I create ...
0
votes
0
answers
11
views
An object reference is required for the nonstatic field, method, or property into dotnet core [duplicate]
I am migrating my windows based application into DOT NET CORE MVC WEB-BASED APPLICATION.
During this time I am getting errors.
My variable details
private DateTime _dateTime = DateTime.Now;
private ...
0
votes
1
answer
78
views
ASP.NET MVC 5 : foreach loop sort and write output in specific order
I have a foreach loop in my view and I need it to write data in specific order id HTML sections. The problem is that i don't want HTML section to be seen if there is no data for that section.
int ...
0
votes
1
answer
19
views
JQuery FileDrop.js How To Read Data Params in Controller?
Using ASP.NET MVC 5, I'm having trouble reading the param data I am sending from my filedrop jquery code into my controller.
Here is my .cshtml filedrop code:
And here is my Controller code, showing ...
0
votes
2
answers
39
views
Maximum request length exceeded in DOT NETCORE MVC c#
I am working on DOT NET CORE MVC C# Project.
I am getting the error when I am trying to upload a video of size 500MB or 1GB to my site.
How do I fix this?
After searching on web perform two task but ...
0
votes
1
answer
22
views
c# MVC5 @Html.EditorFor datepicker never displays the value
Sorry to bother but I've been headbanging on this topic for 8 hours
tried all the suggested solutions here and there and nothing changes (in good).
If someone could help... pleaaaase ...
I have a view ...
0
votes
1
answer
96
views
File download problem - ASP.NET MVC application
I have two controller actions and js in a view in an ASP.NET MVC application to generate and download an Excel file. All relevant code is shown here:
public ActionResult GetExcel()
{
string handle ...
0
votes
0
answers
23
views
In foreach JSonResult return value ajax
Is it possible to return value in loop ?
i call Jsonresult to generate excel file. I create one page per person in my excel file.
For exemple i have 5 people. I want to dislpay
1/5
2/5
...
on my ...
0
votes
0
answers
25
views
Html.ValidationMessageFor() shows all the time in Partial View with Begin Form
I have gone into quite a specific problem, because I haven't found solution to this in StackOverflow. Some similar topics about this issue have some suggestions, but I don't see how I could use them ...
0
votes
2
answers
148
views
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'portal.Models.SubProjectViewRecord'
I've got this simple code that will consume api json array from a url.
public ActionResult ViewRecord()
{
ViewBag.Title = "- Geotagging Sub Project Record.";
...
0
votes
1
answer
32
views
Replace modelItem value of '0' with user friendly 'N'
I have an MVC5 C# web application.
My Index View brings back results in a table, using @foreach. Some of the fields are int and use 0 and 1 to designate No and Yes, respectively.
On the View, how do ...
2
votes
1
answer
189
views
ASP.NET MVC 5 / C# Foreach loop - repeats same data
This seems pretty 'beginner' but I am struggling.
I have a SQL Server view that joins two tables (Employee and Cars). I have a model for that view.
When I open SQL Server Management Studio and query ...
0
votes
0
answers
33
views
Only one or two files are uploading to server
I am using Dropzone to upload six files in parallel; it works fine locally (localhost). But the same code does not work as expected on QA environment. It uploads one or two files on server when I try ...
0
votes
1
answer
19
views
Url.IsLocal throws null reference exception
Url passed in is: "/Reporting/Dashboard"
Why is the Url.get returning null?
public ActionResult RedirectToLocal(string returnUrl)
{
if (Url.IsLocalUrl(returnUrl))
{
return ...
0
votes
1
answer
39
views
Create Id for the related table when new data is added to the current table MVC 5
I have an application that needs to be filled in after registration, I have a User and a related Application table.
I want that after user is registered and the data was added to the User table, new ...