asp.net-mvc-2

NServiceBus and ASP.NET MVC 2: When to use asynchronous controllers?

ASP.NET MVC 2 includes the built in feature of asynchronous controllers. My question is: Is there any benefits on using the asynchronous controllers to send messages to the bus if I'm not waiting for a reply from the bus? Microsoft states this in their async controller documentation: In general, use asynchronous pipelines when the f...

MVC 2.0 Routes. Redirect to specified controller/action if wrong url

I have a couple of questions about controllers and routes in asp.net MVC 1) By default Index() action from Home Controller will executing if i type "http://mymvcsite" or "http://mymvcsite/Home" or "http://mymvcsite/Home/Index". What is the better way to configure routes to allow only "http://mymvcsite" or "http://mymvcsite/home". e.g ...

MVC ControllerActionInvoker and invoking actions

Hi Is it possible to use a custom action invoker without having to instantiate it in the Controller handler factory? For example //in Custom controller factory IController IControllerFactory.CreateController(RequestContext reqContext, string controllerName) { var controller = base.CreateCOntroller(req...

Syntax ViewData in ASP.NET MVC

Can anyone explain to me what the following syntax mean? ViewData ["greeting"] = (hour <12 ? "Godd morning" : "Good afternoon"); Thanks. ...

ALL of my injected controllers' constructors are hit 4 times for each request

I'm using MVCTurbine in my application which automatically injects my controllers in my asp.net-mvc 2.0 website. My master pages, view pages, css, web.configs and javascript files are in my mvc project, all the rest (including the global.asax) are in seperate libraries. When I put a breakpoint at my Controller's constructors I notice th...

Performance issues on ASP.NET MVC 2 with SQL Server

Hello, EDIT: I think it's a problem on the subquery on the LINQ-generated query, it get all the records... But I don't know how could I fix it I have made a simple ASP.NET MVC 2 application that does SELECT queries on a view, I get really poor performance, and while doing a simple benchmark with jMeter (10 conccurents connection) while...

MVC2 without Routing

I have a case where MVC's routing (mapping a url to a controller) is just getting in the way. I want to circumvent it and send all urls to a single controller (no matter the format and without any attempt to parse them). I assumed this would be easy, but I'm stuck. Help is much appreciated. ...

Nested arrays in POST in ASP.NET

Hi there. ExtJS grid filter plugin passes filter data in the array (via POST) with such fields: filter[0][field] => Id filter[0][data][value] => 42 filter[0][data][type] => integer What is the simplest way to retrieve all N filter sets in asp.net (mvc2) ...

ASP.NET MVC2 + Ninject + NLog (+ shared hosting?) = NullReferenceException

I have an MVC2 app that's based on the Tekpub Starter Site, so it uses Ninject for dependency injection, NLog for logging, and a bunch of other libraries in various places. As far as I can tell though, it's these that are causing my problem. Everything works beautifully on my PC using the ASP.NET dev server (Cassini) but when I deploy ...

Dto and domain entities. Did I create my dto correctly?

I have the following domain entity: public class CartItem { public virtual Guid Id { get; set; } public virtual Guid SessionId { get; set; } public virtual int Quantity { get; set; } public virtual Product Product { get; set; } } I have the following DTO: public class CartItemDTO { public CartItemDTO(CartItem c...

ASP.NET MVC2 RenderAction makes parent loose ViewModel context

I'm my Project Browser page I have 2 sub-elements that warrant their own controller (and not simply a user-control) - Upload and FileBrowser, and so I've added them using Html.RenderAction(Action, Controller, param). The problem however, is that the Browse page requires ProjectViewModel, where Upload uses UploadViewModel, etc. etc. So b...

ASP.NET MVC redirect from attribute

Hi, I'm trying to execute a Redirect from a method attribute. It seems to work: public class MyAttribute: ActionFilterAttribute { [..] public override void OnActionExecuting(ActionExecutingContext filterContext) { [..] filterContext.HttpContext.Response.Redirect(urlToRedirectTo, true); [..] The onl...

ASP.NET MVC Experiences/Success Stories [2010]

Hi, At the moment we're evaluating whether it's worth it to start using ASP.NET MVC in combination with Visual Studio 2010. I've been searching the web for experiences developers have had with working with ASP.NET MVC. I can't seem to find any. So I decided to post a question here. Are there any people out there that have used ASP.NE...

Having MVC 2 with both VS 2008 and VS 2010

I had VS 2010, which gave me MVC 2 out of the box. Then, I installed VS 2008 Professional Edition. I wanted to do MVC 2 with VS 2008. I had to download MVC 2 for VS 2008 SP1, which I did. Now, when I try to install MVC 2 for VS 2008 SP1, it tells me that I already have MVC 2 installed in another location and I must remove that first. I ...

Generating zip file using c# code

I want to create zip file from my mvc.net c# application by using the .net framework classes. Please response to me as soon as possible. ...

ASP.NET MVC2 Client Validation bug?

I enable client validation using the Html.EnableClientValidation method in my view. This client-side validation works great for text boxes, but I think I might have found a bug when used with dropdownboxes. If you use the following construction Html.DropDownList( name, data, "Please choose..." ) without any ViewData-item with that name ...

Ajax login with ASP.Net MVC 2

This question is related to http://stackoverflow.com/questions/2185479/asp-net-forms-authentication-without-redirect only I cannot get it to work. MVC 2 changed its script files and they are now gotten as listed here: http://www.asp.net/ajaxlibrary/CDNAjax4.ashx Now I'm just shooting in the dark but trial and error has narrowed me dow...

ASP.NET MVC model binder not parsing ISO DateTime correctly.

I've been trying to post a form to my controller: Id=0&ReportDate=2010-08-09T00%3A00%3A00&SampleText=Save That's the XHR post that is sent, my controller picks up all the properties except ReportDate, instead setting it to the .NET epoch DateTime. Any ideas? Edit: If I set another variable, ReportDateString, send the string to the co...

ASP MVC Jquery Tabs

Hey all. im writing application on asp mvc. so, i have jQuery tabs on index.aspx, which contains same ascx control - "ChildMain": <div id="tabContainer1"> <ul> <li><%=Html.ActionLink("test1","ChildMain")%></li> <li><%=Html.ActionLink("test2","ChildMain")%></li> </ul> </div> $(document).ready(function () { ...

How can I run RavenDB in a shared hosting environment?

RavenDB has the ability to run in 'embedded' mode, which as far as I understand, should allow it to be run in a shared hosting environment. Does anyone have any idea how it would work in an ASP.NET MVC application, and what the best practice for doing it would be? Are there any dependencies in the hosting environment that I need to be ...