asp.net-mvc

Model Binding to a nested list

Hi all I have a nested list I wish to accept as a parameter to my Action. I've used Phil Haack's Post as the starting point and it works well with a single level list but when the parameter is more complex the model binder passes a null value to my action. (I haven't ventured under the hood of the model binder yet, do I need to for this...

how to set an mvc object to a variable within webform

I have an MVC application with a link to print the information. the print link is inside a javascript. code as follows: <%= Html.TextBox("Name", Model.ApplicantStatus.Name) %> <%= Html.ValidationMessage("Name", "*") %> <script type="text/javascript"> var myEmail = "[email protected]"; var mySubject = "Sample"; var myBo...

Basic MVC routing: /FolderName/FolderName/ControllerName

I have a topLevel folder with a subFolder holding ControllerName. When I enter: http://localhost/FolderName/FolderName/ControllerName how do i tell mvc to account for the folder depth? thx ...

How to use the repository pattern correctly?

Hi I am wondering how should I be grouping my repositories? Like from the examples I seen on the asp.net mvc and in my books they basically use one repository per database table. But that seems like a lot of repositories leading you to have to call up many repositories later on for mocking and stuff. So I am guessing I should group the...

Why Might Masterpage Javascript File References be Wrapped in a PlaceHolder Control?

While reviewing the demo project for the xVal, a validation framework for ASP.NET MVC, I noticed Masterpage javascript references were wrapped in an PlaceHolder control: <asp:PlaceHolder runat="server"> <script type="text/javascript" src="<%= Url.Content("~/scripts/jquery-1.3.2.min.js") %>"></script> <script type="text/javascrip...

Is it secure to POST Credit Card data from View to Controller?

Need to submit some CC data from the View to the Controller where it will be processed, can I just POST it or is there some common way of securing the data in transit? ...

Why won't Visual Studio recognize the new Filter class I added?

I have added a new Filter class to the ASP.NET MVC Filter folder/namespace. There was one previously there as well which Visual Studio is allowing me to find through Filter.blahblahblah, however the new one won't get referenced at all... I don't understand. Do I need to do anything else to get it to find the new filter? using System; us...

"inheriting" ASP.NET MVC sites from a common template app? (multi-tenancy)

We're building about 10 ASP.NET MVC sites which have a common set of features (and corresponding URLs, Routes, Controllers, Actions, and Views). The sites will also all share a base set of domain objects (e.g. users, companies) and base attributes on those objects (e.g. name, address, etc.). But each site will also be highly customize...

ASP.NET MVC Ajax ActionLink OnComplete callback invoked before replace is done?

I have a fairly simple ajax action link. The purpose of the action link is to fetch a partial view from the server and replace the contents of a div with new content. The code looks something like: <%= Ajax.ActionLink("click me", "GetThing", new { Mode = "Simple"}, new AjaxOptions { UpdateTargetId = "thingDiv", ...

Output caching for "almost static" pages in asp.net mvc

Most of the web applications have pages that are "almost static" in the sense they change really very rarely their content, but when it changes this should be seen immediately on the page. So if you have some OutputCache attribute that permits to cache forever on your PageShow method, the cache should be invalidated immediately by a cal...

ASP.NET MVC One Way Route

Is it possible to define a route in the RouteCollection of Asp.net MVC, so that it just does the "URL rewriting" part and ignore the URL generation with Html.Actionlink(...)? In fact I want to add a keyword between controller and action (controller/..keyword.../action) for certain very special requests. The generated URLs on the pages, ...

How to get an ActionLink to append an / to the end of a link

Hi, My question is simple, how to get an ActionLink to append an / to the end of a link. For some reason our SEO team seem to think this is useful? (anyone? why?) currently ActionLink renders the link as More about vouchers but they would like it to be More about vouchers. Does anyone know how to easily do this without constructing my o...

how to pass helper from view to partial view

In the view < % Html.RenderPartial("Sample"); %> In the partial <% Html.CustomExtension("samp")%> in the customextension i'm add some object in ViewData And i need that same ViewData in View after rendering Partial View. Becoz of different helper the ViewData is no maintaining... ...

Cannot host ASP.NET MVC application in IIS

I have created a virtual directory on the IIS (IIS 5.1 that's what i'm using). when i try t o run the applciation from my browser using the URL http://localhost/sitename . i'm able to see the initial landing page . But when i force a controller action call like this . http://localhost/controllername/actionMethodName i receive the 40...

ASP.NET MVC Dynamic entity items

Not really sure if the title reflects what I am actually trying to achieve... I have a view which is used to create a record (invoice) on the same page I would like to be able to add rows to the invoice dynamically or how ever this is achieved. I am just not sure how to do this with MVC and hope someone can point me in the right directi...

ASP.net MVC RTM Test naming conventions

I am working on an asp.net mvc application and writing my unit tests BDD style. Eg. GetResource_WhenResourceFileExists_ShouldReturnResources() But when I am writing tests for my controllers, I usually have two Methods with the same name. One without parameters for get requests and one with for posts. Does anybody have a good naming...

Server side include external HTML?

In my asp.net-mvc application I need to include a page that shows a legacy page. The body of this page is created by calling an existing Perl script. This Perl script is externally hosted. Is there a way to do something like this: <!-- #Include virtual="http://www.example.com/theScript.plx"--&gt; ...

How to Submit Contents of 2 Select Boxes

Hi All I have an ASP.NET MVC applciation containing 2 list boxes: #AvailableItems & #AssignedItems. I can transfer items from one box to the other. I also have some other related values stored as attributes on the Save link that need to get submitted too, like IDs and stuff. When I post the data, I can submit the attributes easily enou...

Publishing as Pre-Compiled ASP.net-MVC Website with VWD Express Edition

Is there a way to pre-compile websites with VWD Express ? Can I use ASP.NET Merge tool or similar utility ? and is there any limitation to options (can I choose whatever options like in VS Pro edition) ...

ASP.NET MVC Entity Framework ObjectContext

We've been going back and forth on how we want to manage our ObjectContext for our MVC enterprise solution. We're looking for the pros and cons of storing your ObjectContext between requests opposed to creating one on each request. Let's say we have product controller routed to from \site\product\edit\34. The edit action calls our rep...