asp.net-mvc

ASP.NET MVC application when deployed to IIS 7 in integrated mode using NHibernate data will not load

We have built an ASP.NET MVC application which utilizes NHibernate, the MVCContrib version of StructureMap, and an onion architecture as outlined by Jeffery Palermo in ASP.NET MVC in Action. This application works well when running locally from Visual Studio 2008. The Index action on our Home controller loads a view which immediately pu...

Asp.net MVC Pros and cons of composition DTOs vs strongly typed model+weakly typed ViewData passing?

I'm trying to find out what the issues are on each side of either composing a DTO that has the model+drop down lists,etc... vs passing those extra objects/lists in the ViewData. I haven't come up with an argument against using ViewData besides the strongly typed purist in me. I thought I would ask what else I might need to consider? ...

how to tack on an extra row at the end for the mvccontrib grid?

I am using the MVCContrib Grid to display a simple shopping cart. I would like to tack on an extra row at the end for the Total? Anyone have any idea of how to do this? ...

CKEditor 3.1 jquery adapter ?

<script type="text/javascript" language="javascript" src="/Content/Scripts/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/Content/ckeditor/ckeditor.js"></script> <script type="text/javascript" src="/Content/ckeditor/adapders/jquery.js"></script> <script type="text/javascript" language="javascript"> ...

Mapping Validation Attributes From Domain Entity to DTO

Hi, I have a standard Domain Layer entity: public class Product { public int Id { get; set; } public string Name { get; set; } public decimal Price { get; set;} } which has some kind of validation attributes applied: public class Product { public int Id { get; set; } [NotEmpty, NotShorterThan10Characters, NotL...

Website redevelopment and preserving Google Analytics

I'm currently working on a project to re-develop a public sector website. The website uses Google Analytics and has done since April 2007, so alot of data has been captured. The new site will be developed using ASP.net MVC and as part of the the redevelopment we want to make the URL's more SEO friendly by getting rid of the ?id=123 and ...

Asp.Net MVC 2 LabelFor Custom Text

Is there a way to use the LabelFor helper and customize the label text without having to use the DisplayNameAttribute in my model? ...

When working with web.config, Configuration class is not available

I want to access the "appSettings" section of a web.config file. According to MSDN and multiple other sources, the following should work: System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("/rootPath"); I received this error on the second configuration (System.Configuration.Configuration): ...

ASP.NET MVC Routing two parameters with static string in between

This is my routing: routes.MapRoute(null, "shelves/{id1}/products/{action}/{id2}", new { controller = "Products", action = "List", id1 = "", id2 = ""}); The thought is that you can do something like this: http://server/shelves/23/products/edit/14 And be able to edit product 14 on shelf 23. Checking it with Route Debugger, t...

Free/Open Source resx files with Standard Phrases

Hello, I was wondering if there are any free/OS resx files for phrases commonly used among websites. For instance, we all use save/submit/retry/cancel/etc. and I'd be surprised if there wasn't a library out there with these standard phrases in multiple languages. I searched but came up empty...Any ideas? ...

Saving data for related Tables with foreign key - Entity Framework

I am having trouble saving my entities to the database using EntityFramework. I have to tables, Player and Address. The Player table has a reference to the Address table by means of an AddressId foreign key relationship. So Player.AddressId points to Address.AddressId. Now when calling the following code, I get an error that says: "A de...

Updating different parts of an MVC page at once?

hi, i want to update different areas of my MVC page after one action (say a click) occurs. how, i use ajax, and wrapping the entire area where all these parts need to be updated is counter intuitive as the ajax data being sent back would be close to the entire page. so, i have a few partial views, - but the problem is, each action only...

Linq with EF dynamic search

I am using EF 3.5 with MVC. I want to made a search page, has some fields for criteria like date, int etc. What is the way in linq to entities to filter the result dynamically. If there are one parameter we can use .where(a=>a.id==1) but many combination with optional param how can i load results and then pass to model. ...

Which part of an application should be responsible for hashing a user's password?

Hi, I'm writing an ASP.NET MVC application which will provide user registration functionality but i am not sure which part of the application (e.g. User Domain model object, Controller, ViewModelMappers) should be responsible for hashing the user's password. I have a registration page that uses a strongly typed ViewModel and a Register...

Difference between Partial VIews and User Controls in MVC

Can anyone please tell what's the exact differences between partial views and user controls in an MVC app? Which one is feasible to use? I am using user controls for filling my views which have one or more tabs(which i have added using Ajax control toolkit). I want to know about advantages/disadvantages while using partial views and user...

how does mvc work when index is returned via ajax?

does it reload the entire page or does it have the intelligence to only send the necessary js to update the needed parts of the page that have changed? if it does the latter that would be a god send, however im probably being dreamful. it probably returns the entire view without any regard, right? edit: answer seems to be no, everythin...

Passing values out of silverlight unto webpage

Is that possible to have values inside a silverlight application be passed out unto the webpage, whether calling a javascript function with the values, etc. The functionality I'm looking for: I have a map in silverlight, I select some values, I click the html submit button that is located on the webpage. The values in silverlight and al...

Applying a common layout to ascx controls in ASP.NET MVC

What would be the best way to implement visual inheritance for partial ascx views in MVC? I have the main Site.Master file which provides a header, footer, sidebar and main content area. Then i have an Info.Master which uses Site.Master as it's master page and which provides a common layout for almost identical pages. Then all these sim...

auto generate javascript to update client html compared to previous html?

do you think it would be difficult to write a framework where mvc compares last html it output to the current html we want to output, and instead of sending the entire html, figure out what has changed and generate js code that will do the updating as compared to previous html? (presuming nothing was manually changed on the client using ...

IOC on IValidationDictionary with Castle Windsor

I'm new to Castle Windsor and am just using the latest version. I've created entries for my repositories which are working fine but I have one final dependency that I'm passing into my controller. I've created a ModelStateWrapper which inherits from IValidationDictionary. The ModelStateWrapper takes a ModelStateDictionary in it's constr...