asp.net-mvc

ASP.Net MVC Routing Issue - Question Mark appears on my links

I have a public website which accepts a pagename, this then defaults to a controller and action with the pagename as the unique identifier to render the correct view. eg. http://www.mydomain.com/homepage I also have a admin area where all CRUD stuff takes place access via a prefix of admin. eg. http://www.mydomain.com/admin/controller/a...

Linq to SQL Entity Splitting

Hi all I've recently started playing around with the ASP.NET MVC NerdDinner sample, and as part of that you get to play around with Linq to SQL classes. This looks cool, so I decided to break away (perhaps a tad prematurely!) and try and create my own MVC application, but this time modelling my own simple database with Linq to SQL. The...

ASP.NET MVC - Access a controller property in an ActionFilter

Hello I'm using Unity to instantiate a new class into the controller constructor and save the injected class in a property inside the controller. Then I want to use an ActionFilter to see if the injected class has some properties that I validate inside it's constructor. So is there a way to use an ActionFilter to validade the properties...

How does hanging code in aspx files of ASP.NET MVC application execute?

This question might sound weird but I am finding it really difficult to digest a typical aspx page in ASP.NET MVC application. For example: <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %> <asp:Content ID="aboutTitle" ContentPlaceHolderID="TitleContent" runat="server"> About U...

Using jqGrid on IIS7

I have jqGrid running fine locally in VS 2008 in a ASP.NET MVC project. When I upload the project to the server (W2008, IIS7) I get an error in IE 8, Object doesn't support this property or method on the call to jqGrid. In Firebug - jqGrid is not a function. All other JQuery plugins works fine (before and after the upload). Any ideas wh...

Ajax in Asp.net mvc

I am using ajax in mvc for partial page refresh. I create a partial view (ie a seperate user control) for each page and then call partial view by using Html.RenderPartial(). I just want to confirm that do I need to create a seperate user control for every page or is there any other way? Any suggestions would be greatly appreciated. ...

What is the most unobtrusive way to add a layer of security for a private beta of website?

Let's say I have an ASP.NET site (MVC in this case) that uses Forms authentication and a typical membership system. The site allows both authenticated and anonymous users. When I release the site as a private beta I want to add another layer of security on top of the application, like superuser's simple password system, for example. Onc...

Deploy ASP.NET MVC on Linux: Best Practices, Tools & Suprises

I'm wondering about best practices to develop ASP.NET MVC apps with an option to deploy on Linux. If you are creating these kinds of MVC apps, What Linux/Mono platform are you targeting? How much of the development are you doing on Windows and how much on Linux? Are you using an ORM to abstract the database? Which one? Are you running ...

Do jQuery and Asynchronous calls together break the MVC Model?

I marked this as Community Wiki since this might be more on the philosophical side of things, but I've been thinking about this on and off for a while. Basically the idea is this: With MVC you have the controller that churns information, the model that carries it, and the view that displays it. It's a simple separation on paper. If I...

How do I expose built-in security and user management to a MVC application?

I have built a MVC website on IIS6. I used the built-in ASP.NET Security without Membership, just the way it was implemented in the template solution. It is easy to secure a contoller or action, but now I need to expose the user management to an admin logged into the site. I understand that the builtin ASP controls for doing this are n...

Specifying read-only session in ASP.NET MVC

Is there any way to specify that a given Controller or Action uses Session state in a read-only manner? In "old" ASP.NET we used to do something like this: <%@ Page EnableSessionState="ReadOnly" %> Is there an ASP.NET MVC equivalent? I'm looking to allow my application to serve multiple requests from the same client simultaneously, an...

Ajax paging work for Firefox, not for IE, how to resolve the problem?

I try to implement paging with ajax function. Then I create list view and partial view. Partial view displly data list and paging link List view include keyword for earch and the partial view. My partial view looks like: <div id="MyList"> <div style="text-align: right"> <% for (int i = 1; i <= (int)ViewData["totalPages"]; i++) ...

How to upload files larger than 16k to a WCF-service?

To make a long story short: Making a web application Each user profile contains exactly one profile image, which is stored in the database The bottom layer uses ADO.NET entity framework for data access and relationships between classes Inserting images into the database on the bottom data access layer of the application works fine On t...

How to get parameter in OnActionExecuting?

I modify the default route rule a little bit as below: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id= (string)null } // Parameter defaults ); Then I can set url ...

Make a Linq-to-SQL Generated User Class Inherit from MembershipUser

I am currently building a custom Membership Provider for my Asp.net MVC website. I have an existing database with a Users table and I'm using Linq-to-Sql to automatically generates this class for me. What I would like to do is have this generated User class inherit from the MembershipUser class so I can more easily use it in my custom ...

ASP.NET MVC, Cache individual User Control

How do I cache an individual user control with ASP.NET MVC? I also need the VaryByParam etc support that usually comes with ASPX Output Caching. I don't want to cache the entire action though, only one of my user controls in the view. An example would be nice :) Thank you! ...

ASP.NET MVC Routing Questions

I just started using ASP.NET MVC and I have two routing questions. How do I set up the following routes in ASP.NET MVC? domain.com/about-us/ domain.com/contact-us/ domain.com/staff-bios/ I don't want to have a controller specified in the actual url in order to keep the urls shorter. If the urls looked liked this: domain.com/comp...

MVC UpdateModel when the names don't match up

Let's say that you have a Model that looks kind of like this: public class MyClass { public string Name { get; set; } public DateTime MyDate { get; set; } } The default edit template that Visual Studio gives you is a plain textbox for the MyDate property. This is all fine and good, but let's say that you need to split that up ...

Asp.net mvc view engine - to roll my own intellisense

I'm creating a little special purpose view engine for asp.net mvc. That goes well enough. But i've been looking around to find information on how to somehow add intellisense for the C# code embedded in my view. I can see Spark does that, but going through the sources, I still can't see how. And WebForms view engine does it - not surpri...

how to export MVC detail view data to excel file?

How to export MVC detail view data to excel file? What's the simplest solution? ...