Tagged Questions
ASP.NET MVC 5 is the fifth major version of the ASP.NET Model-View-Controller platform for web applications.
6
votes
0answers
620 views
Web helpers for MVC 5?
is there any documentation for Microsoft.AspNet.WebHelpers for ASP.NET MVC 5?
I'm trying to use FileUpload helper and run out of ideas..
@using Microsoft.AspNet.WebHelpers
tried to put this line ...
5
votes
0answers
193 views
PrepareRequestUserAuthorizationAsync fails
I had very simple code which worked fine for me:
var url = System.Web.HttpContext.Current.Request.Url;
Uri callbackUrl = new System.Uri(url, "oAuth2CallBack");
var ub = new UriBuilder(callbackUrl);
...
3
votes
0answers
129 views
ASP.NET Identity Model First fails because of renamed AspNetUserRoles columns
Like several others I have tried to implement ASP.NET Identity Model First. Everything works fine once you have tried, errored, fumed, searched and resolved.. I thought.
See also:
ASP.NET Identity ...
3
votes
0answers
79 views
Visual Studio 2013 button to add a View is disabled
After create a few views, the button to add a new views got disabled and I cant add views anymore.
Anyone have a hint about that?
EDIT
I can add views using the Add New Item menu and selecting ...
3
votes
0answers
200 views
ElmahR Dashboard throws “Unable to compile template” error when Sending Commands
I worked through the Setup documentation found here. I have a sample dashboard application and a sample client application which throws Elmah errors into a SQL database.
The client application has ...
3
votes
0answers
256 views
Integrating ASP.NET MVC 5 Identity and authentication with ServiceStack 4
I have recently created web services using authentication and roles through ServiceStack 4 including openId and OAuth providers Google, Twitter and LinkedIn backed by a MongoDB repository.
I would ...
3
votes
0answers
445 views
Large file upload when using ssl and client certificates (uploadReadAheadSize) but dont want all data to be readahead
I tried to search the internet/stack overflow and couldn't find any relevant answer that worked for me.
I have an asp.net web api2 application (uses ssl only).
I'm trying to allow large file upload ...
3
votes
0answers
337 views
Adding Scope, “wl.emails”, to MicrosoftAccountAuthenticationOptions in Startup.Auth.cs causes issues
Please tell me what is wrong.
public void ConfigureAuth(IAppBuilder app)
{
var mo = new MicrosoftAccountAuthenticationOptions();
mo.ClientId = "xxxxxxxxxxxxxxxxx";
...
3
votes
0answers
1k views
VS2013 Preview high cpu usage when in theory idle
I have a asp.net-mvc5 application which I am developing and from time to time I can see in windows server2008r2 task manager that devenv.exe (the visual studio 2013 instance I am using)
is consuming ...
2
votes
0answers
26 views
Partial View not loading once made strongly typed
Controller:
namespace AdminPortal.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ...
2
votes
0answers
47 views
Is it possible to do Controller specific routing in MVC5?
I want all my actions in a single controller to point to a specific View folder. I am going to have many AnalyticControllers that Inherit from a parent controller. The goal is to have individual ...
2
votes
0answers
60 views
MVC5/API2 CreateErrorResponse in custom ActionFilterAttribute OnActionExecuting
With MVC4 I was able to create and register a global action filter that would check the model state prior to the action's execution and return the serialized ModelState before any damage could be ...
2
votes
0answers
40 views
Allowing an unauthorized POST to an AuthorizeAttribute-decorated Action
I have a "Add to Cart" button that is always visible, but requires authentication to actually add the item to the cart. So right now, the AddToCart action has an AuthorizeAttribute on it. So when ...
2
votes
0answers
120 views
How to get numbers of online users using .NET Identity 2.0 in MVC 5
Do guys know that how to get numbers of online users using .NET identity 2.0 membership providers in MVC 5 ?
I have scan the methods in UserManager that Identity sample gives but no helping.
2
votes
0answers
69 views
MEF ImportMany/Export(w/Web API, Autofac) not injecting
New to the realm helping its a noob mistake. All I am trying to do is create a plugin style framework where I can just define new ChartStrategy which will automatically be injected via mef.
I'm ...
2
votes
0answers
98 views
Creating Custom Scaffolding templates in visual studio 2013
i am new to MVC 5.0 and i am creating an application using MVC 5.0 with entity framework 6.0 and scaffolding templates and controllers . i want to create custom templates using kendo ui grid for ...
2
votes
0answers
111 views
How to add “selectBoxIt” JQuery plugin in MVC5 project
I have created a simple project in MVC5 (VS2013) to test the functionality of (selectBoxIt) Jquery plugin to style a ComboBox control for selecting site-language. Everything seems configured ...
2
votes
0answers
272 views
MVC 5 WF4.5 : Dynamic View select in running workflow
I am now contemplating on a creating few workflows using WF4.5 MVC 5. Most of these workflows are human workflows (state based), long but quite straight forward. However some of them require me to ...
2
votes
0answers
214 views
Why MVC5 gives this error “The requested resource does not support http method 'OPTIONS' ”?
I have updated my application from MVC4 to MVC5, when I run it with MVC4 it works fine but for MVC5 it gives error {"Message":"The requested resource does not support http method 'OPTIONS'."} in ...
2
votes
0answers
105 views
Set login cookie for subdomain
I have a MVC 5 web application with user accounts.
Each account gets it's own subdomain (http://accountname.myapp.com)
I want to have a central login-page where users can login.
They should be ...
2
votes
0answers
244 views
How do I invalidate a session in MVC5 identity?
How do I invalidate a session?
Repro:
Login using a normal account
Export cookies associated with my site
Click the logout button
Confirm that I'm logged out of the site, the cookie is cleared
...
2
votes
0answers
97 views
Editing Asp.Net MVC 5 Scaffolding does not affect
I just fallowed : http://weblogs.asp.net/imranbaloch/archive/2013/09/15/customizing-the-asp-net-mvc-5-web-api-2-scaffolding-templates.aspx
and edited MvcView\Create.cs.t4 but did not affect on the ...
2
votes
0answers
200 views
MVC5 : Attribute Routing Precedence Among Controllers
I am using the Attribute Routing from MVC5 in my controllers.
Question:
Is there a way to control attribute routing precedence among controllers?
Consider the following
...
2
votes
0answers
123 views
memberNames in ValidationResult not working as expected
I am performing some model validation via a model validator attached to the model at class level. If I find an error I need to be able to attach that error to the relevant field in the view so that it ...
2
votes
0answers
112 views
asp.net mvc DotNetOpenAuth.GoogleOAuth2. 'This app would like to have offline access'
I am using standard MVC 4 project that I have upgraded to MVC5. The only difference from what standard template project is DotNetOpenAuth.GoogleOAuth2 to achieve google oauth2 sign in. The first time ...
2
votes
0answers
179 views
Custom oAuth client in ASP.NET MVC 5
I am confused about how to build the custom oauth client in asp.net mvc 5.
In mvc 4 it was a simple operation. Implementing custom class from IAuthenticationClient. And then in AuthConfig.cs call ...
2
votes
0answers
218 views
ASP.NET Identity setup and Entity Framework data base first approach
I am started looking at ASP.NET Identity Framework. It is powered with Entity Framework 6.
It is using the default database with the number of related tables.
AspNetUsers, AspnetUserRoles, ...
2
votes
0answers
95 views
ASP.NET MVC 5 Identity AddUserToRole not works
I'm trying to insert initial users, roles and attach users to roles using ASP.NET MVC 5 Identity.
When Configuration.AutoDetectChangesEnabled = false for DbContext, which was used for UserManager and ...
2
votes
0answers
250 views
Remove Modules in MVC 5 Application
I am working on an ASP.NET Mvc 5 application with Owin Authentication.
I use my own Roles and Users managers include on my service layer.
I know the application would be slightly faster if I remove ...
2
votes
0answers
239 views
cannot create new user in web-api 2
I'm trying to create a new user when receiving a POST request to api/accounts/ in my asp.net web-api 2 project.
Attempt 1: Create Identity User
I've tried exactly as it was shown in the project ...
2
votes
0answers
121 views
How do I obtain related entities after a concurrency exception in Asp.net MVC?
I am following the asp.net contoso university example from concurrency exceptions. Everything works great for a single entity. But when I want to retrieve related entities database values they are ...
2
votes
0answers
129 views
How to update multiple many to many relationship and check for concurrency exceptions?
I was wondering how could I update an entity with multiple many to many relationships. So if I had a car model with many connectors, inputvoltages, lenstypes and lightcolors. I want the user to be ...
2
votes
0answers
164 views
How to filter Graph Api friends_location that are not empty
I'm experimenting with the new Facebook project template for MVC 5 in Visual Studio 2013. I've added a Location property to the MyAppUserFriend class to get the location of each friend. I need to ...
1
vote
0answers
7 views
ASP MVC 5 FilterConfig for custom exception with view in subfolder
I want to catch exceptions of my custom type MissingSettingException, and show a custom error page.
I am using FilterConfig to specify the view to display:
public class FilterConfig
{
public ...
1
vote
0answers
14 views
Error with WebApi 2.0 RouteAttribute
Here's my Global.asax
protected void Application_Start()
{
RegisterRoutes();
}
private static void RegisterRoutes()
{
AreaRegistration.RegisterAllAreas();
...
1
vote
0answers
17 views
Handling concurrency exceptions when passing the objects ids and timestamps using jQuery
I have the following business scenario inside my Asp.net MVC 4 asset management system :-
Scenario 1) A user selects multiple servers , then he selects a Rack Tag ,and click on
assign . so the ...
1
vote
0answers
27 views
+100
OWIN cookie auth determine sliding session expiration value
I'm in the process of building a single page web app, and I need to detect when the users sliding session expires via ajax calls to the server. In the past, I'd always use FormsAuthentication.Decrypt ...
1
vote
0answers
23 views
Global Asax vs Global Filter
My application is written in MVC5.
I've noticed that my Global.Asax file is slowly filling up with code as the application grows. Particularly there's a lot of code accumulating in the ...
1
vote
0answers
20 views
ASP.NET MVC5: No scope with a Tag matching 'AutofacWebRequest' is visible from the scope
I am encountering an error in my ASP.NET MVC 5 application using autofac v3.5.0, Autofac.Extras.CommonServiceLocator v3.2.0, Autofac.Mvc5 v3.3.2 all with targetframework net45 :
No scope with a Tag ...
1
vote
0answers
41 views
SignalR and MVC5: How to call Controller action method from hub
I'm sorry, I guess this is a very trivial question, since I'm very new to SignalR and MVC5.
Is it possible to call a controller's action method from within a hub?
I only hear people asking the other ...
1
vote
0answers
38 views
Adding check boxes to allow multiple Delete & edit from my html table
I have the following table inside my asp.net mvc view:-
@foreach (var item in Model) {
<tr id="@item.TMSServerID">
<td>
@Html.ActionLink("Edit", "Edit","Server", ...
1
vote
0answers
62 views
Can not edit primary key
I am making an application in c# using MVC and ASP.NET. I have a Year entity that is a table of years and a primary ID, called YearID. When I go to edit the YearID though, it will not change. Can you ...
1
vote
0answers
63 views
SignalR message not working when sending from server side to client
This is my HTML:
<script type="text/javascript">
$(function () {
// Declare a proxy to reference the hub.
var chat = $.connection.khaosHub;
// Create a function ...
1
vote
0answers
39 views
MVC Controller background operation
I'm doing a webpage that getting a argument from query-string. This webpage only insert this argument into DB. Nothing more.
The user getting getting empty document back. Like this:
public ...
1
vote
0answers
36 views
Abstract ASP.Net Identity 2.0 & Entity Framework From UI (MVC project)
So I assume some of you are familiar with the concept of the onion architecture discussed here http://www.develop.com/onionarchitecture and in other places.
Essentially, I am working towards building ...
1
vote
0answers
46 views
Custom validation attribute not working client side
According to this post and this one I tried to implement custom validation for greater than logic.
So I have the following code :
public class DynamicRangeGreaterThenValidator : ...
1
vote
0answers
43 views
How to access all ASP.NET Identity 2.0 PasswordValidator properties?
I set multiple properties on the PasswordValidator, but the only rule that is checked is password length.
public static ApplicationUserManager ...
1
vote
0answers
55 views
ASP.NET WebAPI2 BearerToken redirects to Login page instead of returning 401
I created a new web application containing MVC5 and WebAPI. Now I added a new API-Controller and added an Authorize-Atribute (System.Web.Http). Authorizatin works fine, and values are returned. But ...
1
vote
0answers
47 views
How should a C# Web API model binder provider work?
I have the following:
request url: 'endpoint/1,2,3?q=foo'
action to which the request is bound:
public object Bar([ModelBinder] List< T > ids, [FromUri] string q)
I want to map the "1,2,3" ...
1
vote
0answers
56 views
MVC View rendering as raw HTML
I use this code in my Global.asax file to catch all 404 errors and redirect them to a custom controller/view.
protected void Application_Error(object sender, EventArgs e) {
Exception ...