asp.net-mvc

Routing issue when using ASP MVC 2 areas

I am using asp mvc 2 areas. I am trying to set up the project such that when the web site is launced it calls one of the controllers in my areas instead of the default home page. When I update the routes in the Global.asax file, it doesn't seem to work. It is giving me an error since it is looking only in the views directory and not in...

What should the action return when submitting multiple forms in an MVC app?

I have a form with multiple tabs. Each tab has its own <form>, defined like this: <% Using Html.BeginForm("Save", "FirstSection")%> I've got a master Save button that submits all the forms on the page like this: $("form").each(function() { $(this).submit(); }); The problem is that I don't know what each Save action should return: ...

Custom role provider does not implement inherited abstract member

I need some help implementing a custom role provider in a asp.net mvc app. The problem is that I'm getting several errors like: MyRoleProvider does not implement inherited abstract member 'System.Web.Security.RoleProvider.RoleExists(string) I get the same error for other methods. However, I do have implementations for those... My we...

How to get the physical folder of the current view with ASP.NET MVC?

I have a separate utility class that is called in the controller, and i need to access a file inside the Views folder. Inside the the Views{controller} are a couple of sub folders that contain the different views. What I'm looking for is something similar to using: HttpContext.Current.Request.PhysicalApplicationPath to get the physic...

How to ensure valid version of System.Web.Mvc is used

My hosting provider has MVC 2 Preview 2 installed on server. How to ensure my app uses MVC 2 Beta dll ? ...

Passing selected row IDs from jqGrid to ASP.Net MVC Controller Action

I have cascading jqGrids (State, then City, then Zipcode) on a View with multirow on. I can select one or more of the ID values for the zip code by grabbing data using the following: var s; s = jQuery("#zipList").jqGrid('getGridParam', 'selarrrow'); "s" ends up containing something that looks like "23,119,5932,44". I am trying to pass...

SQL Server Session for an Asp.Net MVC application

Isn't SQL Server sessioning for an ASP.NET MVC application fundamentally the same as ASP.NET? If so, do you guys traditionally impersonate your front end user for the sessioning database or setup a static SQL Server user? Just trying to setup our permissions for our MVC app. Thanks! ...

Chose to render different View (ASPX) file in ASP.NET MVC

Hi folks I have this public class HomeController{ public ActionResult Index() { //do stuff return View(); } Obviously this choses and renders Index.aspx in the Home folder. What we really want is to chose another file - Index.ar.aspx - if the CurrentCulture is ar-AE. I don't want IF statements on every re...

Best practice for returning a response from a partial view

I'm writing a simple blogging platform with ASP.NET MVC. My question is regarding forms contained in partial views and handling the response, validation errors or success, from the controller. I have a blog post item view which has an associated controller that returns a post for a given URL. Embedded in this view is a partial view cont...

Looking for resources about asp.net development for mobile phones

I'm looking for any kind of resources about the development of ASP.NET (MVC) web applications for mobile phones (especially phones with webkit-based browsers). As an example, I know about the jQTouch javascript-framework which is mainly targeted at iPhone development. Are there any other frameworks, articles, best-practices, etc. which...

How do you best offload a database insert, so a web response is returned quicker?

Setup I have web service that takes its inputs through a REST interface. The REST call does not return any meaningful data, so whatever is passed in to the web service is just recorded in the database and that is it. It is an analytics service which my company is using internally to do some special processing on web requests that are ...

What version of ASP.NET MVC 2 do I install on my Web server if I developed a solution using ASP.NET MVC 2 on Visual Studio 2010 Beta 2?

If I develop a site using the version of ASP.NET MVC 2 that ships with Visual Studio 2010 Beta 2, what do I install on my Web server to get to run correctly? From what I've gathered, there are two paths for ASP.NET MVC 2. One (the Preview 2, I believe) is included in Visual Studio 2010 Beta 2. The other one, the ASP.NET MVC 2 Beta, is...

Best way to save data on a strongly-typed view when not all fields are loaded

Let's say I have an edit view that is strongly-typed to a table called "MyData". The view has multiple tabs, each with several different fields from the table. For performance, the data is only loaded when the tab is viewed, so if you only edit a field on tab 1 and submit the form, the data for tab 2 will not be loaded. The problem I'm ...

asp.net-mvc newbie

I'm kinda new to the asp.net-mvc framework and I was wondering whether anyone had some good starting places. Basically my boss is wanting me to learn the framework in the shortest time possible as there is a big project coming up soon that she wants written in mvc. thanks ...

Running ASP.NET MVC application in a subdirectory, getting 404 errors

Hi all, I have an application that uses ASP.NET MVC. I have it deployed to a Crystal Tech server (hence, no direct access to IIS control panel). Initialy this was running in the root directory and everything was OK. The client then decided that it needed to run in a subdirectory. I moved the app there and the home index page comes up,...

Asp.Net MVC 2 Beta ModelBinder Change

I am trying to modify the following custom model binder according to the ValueProvider breaking changes in MVC 2 Beta. protected override void OnModelUpdated(ControllerContext controllerContext, ModelBindingContext bindingContext) { var obj = bindingContext.Model as Core.BusinessBase; if (obj != null) { var...

How do I unit test a controller method that has the [Authorize] attribute applied?

I've searched stackoverflow and googled four a couple of hours and still not found any solution for my "trivial" problem. If you write unit test for your filtered [Authorize] ActionResult, how do you solve the problem to fake that user is authenticated? I have a lot of ActionResult methods that are filtered with [Authorize] and I want ...

Why does my LINQ to SQL query fail the first time ("Row Not Found or Changed") and succeed the second time?

I'm using LINQ to SQL in ASP.NET MVC. I wrote some new code to update Orders in our system, and as far as I can tell it's exactly like a hundred other similar pieces of code I've written (grab the object, update some fields, submit changes). This time though, when I try to run the update, I get a "Row not found or changed" LINQ excepti...

Tinymce Model Binding with ASP.NET MVC

Hello, Does anyone know how to auto-populate the tinymce editor from the ASP.NET MVC model? In other words, what code do I need to use to set the contents of tinymce? EDITED: My problem is that tinyMCE is hiding my textbox contents. It opens blank, even though if I view the source of the page in my browser, it shows the correct info (i...

Global state in asp.net mvc application

Problem: Our web console shows a list of all computers on which our application is installed. Each machine has some identification information that can be associated with it. Simple strings like department name, team name etc. We need to make it such that the user can change the name of these identification fields and add/remove as many ...