ASP.NET MVC 5 is the fifth major version of the ASP.NET Model-View-Controller platform for web applications.
0
votes
0answers
3 views
How to pass an array from main view to partial view in asp.net mvc 5
I've a main view that contains an array received from the corresponding Action and it also contains a partial view reference below
Create.cshtml :
@model HrAndPayrollSystem.Models.EmployeeMasterA
@...
0
votes
0answers
8 views
How to use stored procedure on MVC 5 with DbContext?
I created my Controller item using the Entity Framework, and edit the controller Create method.
db.Users.Add(user);
db.Users.SqlQuery("usp_CreateNewAccount fsdfsdf, sdfsdfsd, dasda");
db....
12
votes
3answers
3k views
Understanding the VS2013 MVC 5 SPA template
I've started playing with the Single Page Application template for MVC 5 that comes with Visual Studio 2013. I'm more than familiar with Knockout.js, and although I wasn't with Sammy.js I've been ...
1
vote
1answer
12 views
Filter by DateTime Range MVC 5
Good evening everyone,
I home, anyone can help my with Date time range filter on view part.
Here is my model:
public class IndexVM
{
public DateTime? StartDate { get; set; }
public DateTime? ...
0
votes
1answer
17 views
How to do the Authorization in Asp.net by using Identity Framework?
For doing authorization in asp.net mvc 5 I have searched lot on internet but not getting correct answer. Actually I am using Visual studio community edition with .net framework 4.5.2 and mvc5. I want ...
0
votes
0answers
15 views
mvc 5 asp.net find out the higher value in the following case
following table, idia is to count each bid higher bids with the status 1,
id rate cur Request Sold request at status
1 13 USD 400 0 2016-12-08 11:28:01 1
2 13 USD 400 0 2016-12-08 ...
1
vote
2answers
36 views
ASP.NET MVC 5 Submit Formdata from two linked Data Models
I have two linked models in an ADO.NET Entity Data Model.
AspNetUsers
public partial class AspNetUsers
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:...
0
votes
2answers
38 views
MVC 5 asp.net, viewbag from controller to view is not working
this is the controller
public ActionResult Test() {
@ViewBag.TheMessageIs = "this is the message";
return RedirectToAction("Details", new { id = theId});
}
on the view of Action Named Details I ...
-1
votes
0answers
11 views
Why modelstate.isvalid fails in my MVC login?
public ActionResult Login(EmployeeRegistration model)
{
if (ModelState.IsValid)
{
using (ZstoneContext db = new ZstoneContext())
{
var v = ...
0
votes
2answers
19 views
Flag Role Enum with JWT Bearer Token and Custom AuthorizeAttribute
I am currently working on building a Web API that has JWT and OWIN authentication using MVC 5 and Web API 2. I seem to have all of that working as intended. However, I would now like to implement ...
0
votes
0answers
14 views
Dapper ORM vs Stored Procedure
I am working on a project where we are using DbContext but not EF for CRUD functionalities. We are using service layer for our business logic where stored procedures are written to fetch/send data to ...
0
votes
0answers
14 views
HTML5 intranet app: play audio file from file server [duplicate]
Requirement
I am working on a intranet application. All the users, audio files and server are on same network but different computers.
I have displayed recording information in a grid. User should ...
0
votes
2answers
64 views
Action method updates only 1 table MVC
I am newbie and still learning asp.net MVC. I have created a send action method which works by sending amount of money from a user to another based on the account number and the sufficient funds. My ...
1
vote
1answer
17 views
User.IsInRole only works with AD Group SID (rather than Group Name)
If I only use Windows Authorization, I can easily use User.IsInRole("Web Developers") without issue. But, when I add a SQL Role Provider, User.IsInRole will only return true (for Active Directory ...
5
votes
3answers
7k views
MVC 5 Remote Validation
I need to validate an input field value from user before the form is submitted.
I have created an action in my custom controller and decorated the field with it:
action name: CheckValue
...
0
votes
0answers
23 views
Server cannot append header after HTTP headers have been sent. This is when I'm trying to download a file
I'm trying to create a funcionality for generate Excel file, using some information.
This is what happends when I write mi code.
"Server cannot append header after HTTP headers have been sent."
...
12
votes
3answers
13k views
MVC model validation for date
Is there any default validation for MVC 5 where I can set min and max value of date?
In my model i want date validation
public class MyClass
{
[Required(ErrorMessage="...
2
votes
2answers
4k views
Turn off / Disable windows authentication for asp.net-mvc
I created a new asp.net-mvc project and during setup I chose to use Windows Authentication.
Now I like to turn it off(at least for a while).
I changed the web.config to this
<authentication ...
0
votes
0answers
10 views
Microsoft Report Viewer Crashes VS 2015
I'm trying to use Reporting in my MVC 5 project and have followed the many tutorials about adding a report to the project.
It worked fine when the project was in MVC 4. I had the report, the view and ...
0
votes
0answers
16 views
EF works but I can't find the database (but only in the test environment)
My three environments are all acting differently.
EF came with my chosen MVC website project template and I haven't messed with it. I do have a mdf file in my App_Data folder. The location and ...
4
votes
2answers
3k views
How to inject UserManager & SignInManager
I am trying to figure out how to inject UserManager and SignInManager. I have installed Ninject in my application and I am using it in the following manner:
Please consider this to be a brand new ...
65
votes
9answers
90k views
Creating Roles in Asp.net Identity MVC 5
There is very little documentation about using the new Asp.net Identity Security Framework.
I have pieced together what I could to try and create a new Role and add a User to it. I tried the ...
0
votes
1answer
21 views
User-Agent in mvc 5 application
I Have a MVC 5 application whose back-end is web API. For each request to my server I need to provide user-agent which I can get in controller action method like var UserAgent = Request.UserAgent....
2
votes
1answer
83 views
Stored procedure cannot create complex type in entity framework
I have added this store procedure through phpmyadmin:
CREATE DEFINER=`root`@`localhost` PROCEDURE `SelectUser`()
LANGUAGE SQL
NOT DETERMINISTIC
NO SQL
SQL SECURITY DEFINER
COMMENT ''
Select * from ...
-1
votes
1answer
21 views
Yes no confirmation box in mvc 5 with help of JQuery [duplicate]
I want to add confirmation box before saving record in database
with yes no option
if user say yes then record get saved but if he says no then record shroud not get saved
i am using mvc5 with J ...
0
votes
2answers
21 views
How to hide an ActionLink in ASP.NET MVC5 so only a logged in user can see it?
I've created movies (using the movies tutorial) and I want to hide the "create new" link so only a logged in user can see it.
I've tried searching for answers but can't find anything that helps me.
...
49
votes
4answers
19k views
Razor actionlink autogenerating ?length=7 in URL?
I have Link on razor page below.
@Html.ActionLink("Create New Profile", "Create", "Profile", new { @class="toplink" })
I see page view source which is below
<a href="/admin/profile/create?length=...
1
vote
2answers
4k views
ASP.NET MVC 5 Edit Option for Complex List Child
I have an object called Job and one of the properties is a List of Steps:
public class Job
{
[Display(Name = "Id")]
public int? JobId { get; set; }
[Required]
public string Name { ...
13
votes
8answers
37k views
ASP.NET MVC5/IIS Express unable to debug - Code Not Running
I start a VS2013 VB.Net MVC5 Web Application, set a breakpoint in HomeController About method and run "Start Debugging", navigate to About page and receive the message "Code not running - The current ...
0
votes
0answers
23 views
How can I use multiple role providers (Windows & SQL) in my MVC 5 app?
See Update Below Question
Starting with a fresh Web App (MVC 5) using Windows Authentication and Entity Framework, I'm easily able to restrict access using User.IsInRole("AD Security Group").
...
0
votes
0answers
30 views
Method not found error in MVC 5.0 [duplicate]
I am pretty new to asp.net mvc and have started to work in 5.0 version.
This is my controller:
public class DimCustomersController : Controller
{
private Sales_DW db = new Sales_DW();
...
0
votes
2answers
37 views
How to insert (or change) one value to a multiple rows MVC 5 EF
Good evening everyone,
Here is my question:
For example I have model like this:
[Table("Orders")]
public class Order
{
[Key]
public string Id { get; set; }
public DateTime Generated { get;...
-4
votes
0answers
15 views
How can i get the UserId from Sql with string query, thanks [on hold]
I want to get the user id from mysql with string query and i don't know how, can you please help me thanks!
12
votes
3answers
10k views
Complex object and model binder ASP.NET MVC
I have a model object structure with a Foo class that contains a Bar with a string value.
public class Foo
{
public Bar Bar;
}
public class Bar
{
public string Value { get; set; }
}
And a ...
0
votes
0answers
34 views
ApplicationUser custom object is null Identity
public class ApplicationUser
: IdentityUser<int, ApplicationUserLogin,
ApplicationUserRole, ApplicationUserClaim>, IUser<int>
{
public int OrganisationId { ...
-1
votes
0answers
21 views
There is no ViewData item of type 'IEnumerable<SelectListItem> MVC5 [duplicate]
I a newbie in MVC5 and made an application which basically create new accounts for new users. Within the registration form there is a drop down list which asks the new user to choose one of the threes ...
1
vote
1answer
32 views
how to pass variable to property of model in mvc
I have a Model as below:
public class Class1
{
public int Id { get; set; }
public DateTime Start { get; set; }
}
and I have an ActionResult which is like this:
public ActionResult ...
1
vote
2answers
68 views
Return DTO object that contains more than one entity from the service layer
I am developing an .net multi tier application using repository pattern. My data access layer which implements the repository pattern has methods that return the data to Service layer layer which in ...
2
votes
5answers
55 views
redirect login page to welcome page from angularjs
I am creating s web app in which i need to redirect from login to welcome page if my user id and password validated
<script>
var app = angular.module('myApp', []);
app.controller('...
0
votes
0answers
20 views
Using MVC 6 Tag Helpers in MVC 5
Tag Helpers are a nice substitute for Html Helpers in ASP.NET. Code is much easier to read when they're employed. To my knowledge, they're available in ASP.NET Core (formerly ASP.NET 5) MVC 6.
Is it ...
0
votes
1answer
28 views
How to run proration using ASP.NET MVC 5 and ASP.NET
Here are two tables,
amounttbl, amountId - amountValue
requesttbl reqId - reqAmount - Rate - soldAmount, amountId
Data:
amounttbl
amountId | amountValue
---------|------------
1 | ...
1
vote
1answer
15 views
MVC 5 get current user RoleNames
Here i need to list the current user roles, for example if i have many roles, like admin,operator,editor,writer etc and one user name(userone) is in tow roles how i will be able to list the roles like ...
1
vote
1answer
78 views
Equivalent of Policy in ASP.NET Core MVC for MVC 5
Claims based authorization in ASP.NET Core MVC provides [Policy] methodology for the [Authorize] attribute.
Is there an equivalent way of achieving this in MVC 5?
17
votes
7answers
18k views
“Trust relationship between … and the primary domain failed” in MVC5 Authentication
I have a ASP .NET MVC5 application in which I am not using Windows Authentication.
Everything was working fine until I tried running the application outside of the Domain in which it was being ...
2
votes
1answer
11k views
MVC ViewModel example
I've been doing tutorials and trying to learn best practice when it comes to MVC development. The design I'm using below comes from Pro ASP.Net MVC5 by Apress/Adam Freeman. So far, everything is ...
0
votes
0answers
64 views
Is it possible to stop nested loop running too many times without editing the database?
I trying to learn to code ASP.Net MVC 5 using the pre-existing database (I am unable to modify it).
It went well considering I have very limited Linq/MySQL experience, until I got stuck on the result ...
1
vote
1answer
34 views
Errors trying to publish precompiled ASP.Net MVC 5 project
I have my project running on localhost and production, however because of the slow first access of each view, I'm trying to publish it precompiled (Precompile during publishing > (Disabled) Allow ...
3
votes
2answers
454 views
Unit test anonymous user against controller with authorize attribute
I am trying to build a unit test to make sure an unauthenticated user is unable to reach a controller. when i run the test, the users is being found as authenticated. how do i mock things up so that ...
0
votes
1answer
35 views
ASP.Net MVC5 – “Resource Cannot be found” error
newbie here. I get the error The resource cannot be found. when requesting url /event/details/3.
I use a MVVM.
My schema is simple. I have "Event", "Person" and "PersonInEvent" tables. "PersonInEvent"...
15
votes
3answers
6k views
How to download a specific version of ASP.NET MVC 5 source code
I'm looking for ASP.NET MVC 5.0 RTM source code. I've tried to download this from http://aspnetwebstack.codeplex.com/ but it seems to have only the most recent version 5.1.1 RTM. I've tried with no ...