asp.net-mvc

Action access through Windsor IInterceptor

Im looking to handle authorization in an MVC app through the use of a Windsor IInterceptor - because this seems like the only way I can get named access to parameters the action is passed which are relevant for determining if the user has access. From my Intercept method I need access to the action that is called. I figured out how to ...

Logging errors in ASP.NET MVC

I'm currently using log4net in my ASP.NET MVC application to log exceptions. The way I'm doing this is by having all my controllers inherit from a BaseController class. In the BaseController's OnActionExecuting event, I log any exceptions that may have occurred: protected override void OnActionExecuted(ActionExecutedContext filterCont...

Is it absolutely necessary to manually configure IIS6 to use ASP.NET MVC?

I have a web hosting that replied to me it was not possible to alter the IIS6 settings to set the mapping of .mvc to the Asp.Net ISAPI dll, nor enable Wildcard Application Mappings. In short, I cannot change any IIS setting. Is there any way to run ASP.NET Mvc in that conditions? Note: I read a few related questions here about this, b...

Is ASP.NET MVC a bad choice for a large enterprise project?

We are about to embark on a large enterprise application. I am seriously considering using ASP.NET MVC because: We need to use Microsoft technology (biz logic is all C#) Performance is critical I'd like to test as much as possible My team has only used PHP for web development, but are very experienced with .NET winforms (so either w...

Problem with Authorization with IIS and MVC

Hello , Got some problem with settings up the Authorization. First i got : <authorization> <deny users="?" /> </authorization> So i deny all unknown users and then allow them to view those pages: <location path="Default.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </locat...

How would you sprinkle-in ASP.Net MVC into an existing Web Site Project?

I have a legacy (haha) ASP.Net Webforms Web Site Project in Visual Studio 2008 SP1, that I would like to gradually introduce some MVC functionality into. Most of the information I can locate on how to integrate ASP.Net MVC with WebForms seems to assume the use of a Web Application Project. However, it seems impossible to find informati...

asp.net mvc view data

I create a class to hold view data for two different types from my model. class FooBarViewData { public List<Foo> Foos { get; set; } public List<Bar> Bars { get; set; } } I typed my view to a FooBarViewData but it fails to find the type. <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" ...

asp.net mvc view code

I am dynamically generating a table to present some tabular data. Normally I would not go near tables, but for this kind of data it is appropriate. I am noticing my view code is becoming very spaghetti like. Assigning classes on cells and rows in the body of loops is starting to look just awful (bad flashbacks to my asp 3.0 days). ...

Passing ViewData to ViewPage in ASP.NET MVC

Hello, I'm trying to build a custom control in ASP.NET MVC. The thing that I want to avoid is mixing the view (html) and the code (C#) in these controls. After hours of googling and struggling with this problem I've finally thought of creating helper methods that use the ASP view Engine thought the ViewPage class. I'm able to create a...

Asp.net MVC Routing Problem

how many methods for adding style sheets in a page using Asp.net MVC ...

How do I get the collection of Model State Errors in ASP.NET MVC?

How do I get the collection of errors in a view? I don't want to use the Html Helper Validation Summary or Validation Message. Instead I want to check for errors and if any display them in specific format. Also on the input controls I want to check for a specific property error and add a class to the input. P.S. I'm using the Spark Vi...

What's the recommended way of doing a master/detail page using ASP.NET MVC?

Hi, Does anyone have any suggestions/ best practices for doing master/ detail pages using the ASP.NET MVC Framework? Background I've got a page of Client information, under each one I need to display 0 or more related records about that client. The database schema looks something like this: Clients -- one to many --> Client...

using asp.net mvc for REST based endpoint

I'm looking at using ASP.Net MVC as a platform for a REST based Service. I know WCF has built in support for REST services; however, I'm looking at returning multiple types of data depending on the request. I would like the client to request the content type. So if they send text/html for example I would render my model into Html, if t...

Creating an API with ASP.NET MVC - All in one project, or two projects?

So I've recd. a requirement to create an API to access our application. Not all controller actions are covered by the API (maybe 50%). I figure I can either use the same project, check the http headers for each request and respond with either xml, JSON or html as required (much like rails). OR Create a new ASP.NET MVC application, d...

ASP.NET web forms as ASP.NET MVC

I am sorry for possible misleading about the title, but I have no idea for a proper title. Feel free to edit. Anyway, I am using ASP.NET Web Forms, and maybe this isn't how web forms is intended to be used, but I like to construct and populate HTML elements manually. It gives me more control. I don't use DataBinding and that kind of s...

What's the best way to commit a serialized JQuery sortable result to the database?

I am using the JQuery.Sortable() function to create a reorderable list of items like so <script type="text/javascript"> // When the document is ready set up our sortable with it's inherant function(s) $(document).ready(function() { $("#goal-list").sortable({ handle: '.handle', placeholder: 'ui-st...

How to Inspect ModelStateDictionary in ASP.NET MVC

I'm getting a "An item with the same key has already been added" when using the ModelStateToTempData filter from MvcContrib. I'm trying to figure out what the duplicate key is but can't figure out how to inspect the model state at the point that the filter is adding the keys. Is there any way to do so without hooking up to the MvcContrib...

Html.RenderAction. Why is it not included in MVC RC1?

I am torn between the idea of using Html.RenderAction vs. Html.RenderPartial for partial views. Using RenderPartial means manipulating and passing ViewModel, something I feel is cumbersome. RenderAction is neat and concise in this case but not included for RC1 (included with futures though). Why is it so? Any specific reason? ...

How do I bind to a specific array element in ASP.NET MVC?

I'm using ASP.NET MVC RC1 and trying to bind a textbox to an object property like so: <%= Html.TextBox("Comments.Contacts[0].ContactName") %> It seems like it should work, since this does: <%= ((MuralProject)ViewData.Model).Comments.Contacts[0].ContactName %> But alas, the result in the textbox is an empty string. Am I doing someth...

Is the Content folder sacred in asp.net mvc?

Is the Content folder special to the underlying framework of MVC? I can't find any reference to it in routing code or configuration. I'm just wondering if static content can be handled in different ways. On a related note, stackoverflow's script and css content seems to be retrieved by version number in the querystring: <link href="/...