1
vote
1answer
19 views

Files that are upload does not show up in the Project solution(Mvc5)

I have implement the following code to upload a file. The file is upload to the location ("../App_Data/uploads") but it does not show up in the project. I have to include the file manually in the ...
-1
votes
1answer
7 views

Cannot implicitly convert type 'System.Linq.IQueryable.Models.Discussion to Models.Discussion. An explicit conversion exists

This my Controller public ActionResult Chat(int id){ Discussion discussion = db.Discussion.Where(e=>e.Talep.ID.Equals(id)); // it gives the error at this line return View(discussion); ...
0
votes
1answer
43 views

Calling Async Methods in Action Filters in MVC 5

I'm writing an Action Filter (inheriting from ActionFilterAttribute) which uses HttpClient to POST data to an external server in the OnResultExecuted method. HttpClient has the method PostAsync which ...
0
votes
1answer
28 views

Entity Framework code first one-to-many relationship

I'am trying to make a one-to-many relation through Request and Discussion tables. The fallowing code works fine but I want to make the Request.ID property to be foreign key instead of having a extra ...
0
votes
0answers
42 views

MVC 5/Entity Framework 6 show incorrect values

I am fairly new to MVC and web programming. I have been using the following article from Microsoft - ...
0
votes
0answers
15 views

Concurrent Request from same client is not processing. Its timed out

If two concurrent requests are made for the same session (by using the same SessionID value), the first request gets exclusive access to the session information. The second request executes only after ...
0
votes
1answer
17 views

Creating an ActionLink and MapRoute that there is a constant name in it

In my Asp.net MVC 5 (C#) project I want to create some links by @Html.ActionLink or every you know is better like: /Tags/Linq /Tags/SqlServer /Tags/MVC That Tags is constant name and ...
0
votes
0answers
11 views

IOwinContext context is null

I have moved my mvc4 application into mvc5 by creating a new application and copying the code in - to avoid any conflicts while updating the DLL's When I debug my new solution, no pages can be loaded ...
0
votes
0answers
19 views

Sequence contains no elements WITH PagedList.Mvc

I'm using the MVC Pager on a results from a Query And I keep getting the above error , I'm trying to "paged" there results I'm getting for each writer movies Without a pager and on "page one I ...
0
votes
1answer
50 views

Asp.Net MVC 5 ModelState

I have a simple message system on my project. I have name property and if my User is in role Admin, I get the name by User.Identity.Name instead of getting it from View and since I made the name ...
0
votes
2answers
32 views

Asp.Net MVC 5 The ViewData item that has the key 'UserId' is of type 'System.String' but must be of type 'IEnumerable<SelectListItem>'

I am trying to list the users in a dropdownlist, this is my controller: var user = db.Users.Where(e => e.Roles.All(r => r.RoleId != "1")) .OrderBy(e => e.UserName); ...
0
votes
1answer
32 views

How to get controller's value to be used in Ajax.BeginForm OnSuccess or OnComplete method?

I need to get a value from an Action method and use the value within the OnSuccess method in Ajax.BeginForm. At the moment the actual problem is whenever I want to do this using ViewBag or ViewData ...
0
votes
0answers
27 views

StructureMap.MVC5 best way to get service instance outside controller

I'm using StructureMap.MVC5 with auto registration. public class DefaultRegistry : Registry { #region Constructors and Destructors public DefaultRegistry() { Scan( ...
0
votes
0answers
37 views

Value cannot be null. Parameter name: stream?

I use WebMarkupMinMvc to compress html like following: [CompressContent] [MinifyHtml] [OutputCache(CacheProfile = "CacheCompressedContent5Minutes")] public ActionResult Index() { … } This is ...
4
votes
1answer
54 views

Any way to override attribute on action method without having to override the whole method?

I'm using attribute routing in MVC 5, but I've began to notice a bit of a pain point. I have a situation where I want to subclass a controller because all the actions are going to do the same thing. ...
0
votes
1answer
33 views

Passing a complex object to the view and posting it back

I'm working on a MVC 5 application. I've got an action taking a complex object as a parameter. This action generates a view, and this view calls another action, that needs this complex object to be ...
0
votes
1answer
24 views

Password recover MVC 5: UserManager.GenerateEmailConfirmationTokenAsync not available in ASP.NET

I was trying to implement the passsword reset token using Rick Anderson's example here ...
0
votes
1answer
20 views

How to stop IIS 7.0 from redirecting to its own page when 403 error occurs

I am working on an asp.net mvc web application, and inside my application I have defined a custom authorization attribute , which will return 403 error if the user is not authorized as follow; and I ...
0
votes
0answers
22 views

Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.

I have an MVC5 Web api project. I am getting following error after deployment, Could not load file or assembly 'WebGrease, Version=1.5.1.25624, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ...
1
vote
1answer
34 views

Receive list of checkboxes in Controller

I have a view where multiple entitys are displayed which the user may then select or not. All of this works fine, however I fail to receive this data in my controller. Controller: public class ...
-2
votes
0answers
22 views

how to add data in application start in ASP.NET MVC 5 [on hold]

i don't know how to add data to Users Table and Roles Table when the Application Starts. i'm going to add a superUser Account automatically at the application start. this account is for a SuperUser ...
0
votes
1answer
29 views

How to control my 401 http response insdie my asp.net mvc for both non-ajax & Ajax requests

I have created the following custom authorization attribute inside my asp.net mvc 4 web application. [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited ...
0
votes
1answer
34 views

WebAPI - Can it be used to Logout a user?

This method when called in a WebAPI controller from the client via an AJAX call returns a 200 code but the user gets re-authenticated upon a page refresh. What am I doing wrong? [HttpPost] ...
0
votes
1answer
20 views

Show Menu Link to Logged In Users ASP.NET MVC 5

So I am brand new to the whole ASP.NET MVC 5 thing and I am creating my first mini application. I need to show the profile link only after a user has logged in. I have a profile controller and the ...
0
votes
1answer
36 views

handling my unauthorized requests , with an http 200 response + custom message

I have the following custom authorization class inside my asp.net mvc web application, which i call before my action methods:- [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, ...
0
votes
0answers
14 views

MVC5 Manual login from Client application

i have an mvc5 application that allow user login throught the built int account controller. What i need is to enable thrid party software to call actions of other controllers or signalr hub methods. ...
2
votes
4answers
25 views

EditorTemplate not rendering as expected?

I have a requirement to be able to dynamically add/remove rows to a Tabel in an MVC 5 Application I am working on. I have also included knockout in my project as I use it to post back to preform ...
0
votes
2answers
25 views

How to add column separator in Grid created by using grid.mvc and bootstrap in MVC5?

I've created grid in MVC5 like . But I want a vertical line as a column separator like I'm using grid.mvc (version: 3.0.0) of nugget package and default bootstrap for VS2013(MVC5). Here ...
0
votes
1answer
38 views

Model is getting null on post on Child Partial page MVC5

I'm trying to get all the data back after user fill the form but when i try to access model as a action parameter I always get model as null. Therefore i tried using FormCollection but still couldn't ...
1
vote
1answer
19 views

ng-model on hidden razor input not working

In my MVC 5 Razor view, I created a hidden field, like this: @Html.HiddenFor(x => x.FormData.UserId, new { ng_model = "selectedEmployee.userId" }) When I perform the necessary ...
0
votes
1answer
18 views

RedirectToAction Redirecting to Non matching MapRoute

I have two map routes routes.MapRoute( name: "RawMode", url: "raw/{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional, ...
1
vote
1answer
26 views

Html Encoding in ASP.NET MVC

I have the following code in a view (Demo.aspx) within a ASP.NET MVC 2 project: Demo.aspx: <% if (!Model.IsValid) { %><%= Model.FirstName %> - <% } %><%= Model.LastName %> - ...
1
vote
2answers
28 views

Asp.Net MVC 5 - The type 'bool' must be a reference type in order to use it as parameter

I am displaying announcements in my home page. While getting announcements from database I am checking whether they are Active or not. If not I am not displaying on homepage but keeping them at ...
1
vote
1answer
13 views

Regular Expression Issue on Model Class

I have a model class with the following property for my country list. [Required(ErrorMessage = "Please select a country")] [RegularExpression("^(?!----------------$)", ErrorMessage= "Please ...
0
votes
1answer
25 views

Asp.Net MVC 5 saving rss feed to database

I am getting rss feed from a another website and in case that website shut down, I don't want to get an error. So in order to avoid from error I am trying to save rss feeds to database and if the rss ...
0
votes
0answers
14 views

custom HttpParameterBinding not being called

I added a custom parameter binding to my ASP.net MVC app (version 5.2.0), by adding the following to Global.asax.cs GlobalConfiguration.Configuration.ParameterBindingRules.Insert(0, desc => new ...
0
votes
0answers
14 views

VS2013 Scaffolding Error when constructing view

I'm getting a curious error when attempting to generate a view via the 'Add View' dialog. Simply leaving the dialog as is (ie creating view 'View') and hitting 'Add' yields the following error ...
0
votes
0answers
45 views

doubts about storing and processing JSON

I have to implement a server side code to a Form Builder front end component which allows to create Forms through drag and drop, something like in this link When the form is created a JSON is ...
0
votes
0answers
34 views

MVC 5 - Resolving DataAnnotations at runtime

We need to resolve dataAnnotations at runtime for the nature of the project and configuration. Apparently one of the options (without using custom attributes preferably) is to subclass ...
0
votes
1answer
26 views

Process input before model binding

I have a Model that has an integer property. Everything works find except when a user enter a comma in the input. eg: 100,000 Is there a way to get rid of commas before model binding? I know I can ...
0
votes
1answer
31 views

Can't check in .mdf/.ldf in App_Data into TFS

I am working with ASP.NET C# MVC 5. .mdf/.ldf files in App_Data do not appear on Pending Changes in team explorer. Therefore I can't check them into TFS(visual studio online). I've tried recreating ...
-2
votes
1answer
22 views

How to remove Bootstrap from ASP.NET MVC 5 Application to use other new HTML Framework? [closed]

I was trying to use other HTML 5 framework other than Bootstrap. I want to remove the Bootstrap from my application completely without leaving any trace in the codes. How do I do it other than ...
0
votes
0answers
19 views

The selected stored procedure returns no columns, when i try to import my stored procedure inside my asp.net mvc

I have the following stored procedure inside my SQL server 2008 r2 & asp.net mvc web application :- USE [ITSERres] GO /****** Object: StoredProcedure [dbo].[AdvanceSearchSP] Script Date: ...
1
vote
1answer
109 views

Understanding MVC-5 Identity

I created a new ASP.NET MVC-5 application with Individual User Accounts and then updated all the Nuget packages in the solution. Now I'm trying to follow some of the guidelines shown in some tutorials ...
0
votes
2answers
19 views

Conditionally render tags to different views?

Am using a view with table (simple html tags) one like below to render in to two different views. This table is inside MVC views>shared folder so does indicating its used by two different views. ...
0
votes
0answers
57 views

MVC View giving “An error occurred while processing your request.”

I have created views in an MVC 5 application using the scaffolding option of "MVC 5 Controllers with views, using Entity Framework". This ties to my Azure hosted DB that the models in my MVC project ...
1
vote
2answers
49 views

ASP.NET Identity - Steps for custom authentication

Envrionment: Visual Studio 2013, ASP.NET MVC 5 On the new MVC5-based project I will be working on, I need to use a custom database that stores usernames, passwords, and roles in its own way. I am ...
0
votes
0answers
19 views

YuiCompressor .NET: Inheritance security rules violated while overriding member

I'm trying to obfuscate my js file with YuiCompressor nuget package. After installing the package ("Yui Compressor .NET" + "Yui Compressor .NET - Web.Optimization"), I updated my BundleConfig file ...
0
votes
1answer
39 views

Asp.Net MVC 5 Selecting Elements

I want to show active announcements in my home page. This is my Model: public class Duyuru { public int ID { get; set; } [Display(Name="Mesaj")] public string Message { get; set; } ...
0
votes
0answers
31 views

jQuery UI is not being referenced in MVC 5

I have an MVC 5 application where I need jQuery UI. So I downloaded jQuery UI (Combined Library) version 1.10.4 from NuGet and just to make sure also updated jQuery to version 2.1.1. Next thing I did ...