asp.net-mvc

ASP.Net MVC - Is this entity layer a step too far?

I have a domain data model which returns a class such as the following: public class ZombieDeath { public virtual int ZombieId {get;set;} public virtual FatalHit {get;set;} } public class FatalHit { public virtual int HitId {get;set;} public virtual string Zone {get;set;} public virtual string Weapon {get;set;} ...

Redirect to the same page on application error in mvc .net

I am working in MVC2 .net and getting problem on file upload. If file size exceeds form the limit then i want to show some exception on the same page. ...

Are WCF Data Services (Astoria) a good choice for a Line of Business application?

One of our architects is building a new reference architecture for the next generation of one of our company's applications. The prototype is an ASP.NET MVC 2 web app that sits on top of WCF Data Services (Astoria) and uses EntityFramework 4 for data access and object mapping. The prototype application manages roles of users, so the se...

How can I use jQuery Dialog for Add/Edit screens?

Clicking a link would open a List page in a jQuery Dialog popup. From this page, I would like the ability to Add (one jQuery Dialog) a record and also edit the record (another jQuery Dialog) with validation. I'm not sure how to handle multiple popups with Ajax posts that actually call the add/edit function. I'm working with ASP.NET MVC 2...

asp.net mvc c# javascript web.config

i want to have retrieve a "imagetype" from appsettings in my web.config in javascript . how can i do that? ...

ASP.NET MVC AJAX with HTML.ValidationMessageFor

Hello, I'm used to the ASP.NET Webforms easy way of doing AJAX with UpdatePanels. I understand the process is much more artisanal with MVC. In a specific case, I'm using Data Annotations to validate some form inputs. I use the HTML.ValidationMessageFor helper to show an error message. If I want to use AJAX to post this form and show thi...

asp.net mvc3 razor documentation?

Is there any documentation on how to use Razor view engine using asp.net mvc3? or any other resources? Trying to find it in google and msdn with no luck so far. ...

How to store additional user data using MembershipProvider/FormsAuthenticationTicket?

I have implemented my own custom MembershipProvider with a custom data store. No problems so far. I would like for people to login using their email instead of a username. Because I have my own data store, this is not a major issue, I can just pass the email as the username for the MembershipProvider. My question is, how do I store addi...

Updating my model then re-evaluate IsValid?

I'm passing in some values to my controller action and everything is binding up fine. There will be two properties missing from the form POST by design. I am then setting the missing values but then I want to validate the model and it is still saying false since it looks like the ModelState hasn't caught up with my changes. [HttpPost, ...

Storing/serializing list of objects

I oftem run into this case of what is the correct way to store a list of objects as a property in a class and how to properly serialize them into XML. For instance, we have a TabGroup class which will contain zero or multiple Tabs. Is it better to a have a list of Tabs property or a list of references to Tabs? Provided that Tabs are id...

CultureInfo: Haitian Creole and .NET 3.5 on ASP.NET/MVC?

It's been easy to get French and Spanish translations added to our site, but we want to add Haitian Creole now and there is no Culture support for it. What's the best way to get this done? ...

How do I Improve performance of WCF Web Service?

I have an MVC application that calls several different web services. While running load tests on the application, I noticed that performance (both throughput and response times) degraded quickly as the concurrent users increased. By process of elimination, I stripped everything out except for a single dummy call to the web service which ...

MVC HandleError attribute not working on Controller.

I am experimenting with the relationship between Elmah and MVC's plumbed in exception handling, and am surprised at the outcome of the following code. This is a brand new, straight from project template MVC application, and I have only added Elmah modules and handlers to the web.config. And of the course the 'throw': [HandleError] pub...

What is the elegant solution for unrelated views in MVC web frameworks?

I've had a problem with the following issue in Rails and ASP.Net MVC. Often there are multiple widgets of functionality on a page, yet one controller action is supposed to render the page. Let me illustrate: Let's say I have a normal e-commerce site, and the menu is made of categories, while the page is to display an group of products...

ASP.NET MVC 3 Preview configure for ninject

I'm giving ASP.NET MVC 3 Preview 1 a spin and want to configure ninject with it. Is the best way still to use ninject.web.mvc extension? The sample Scott Gu posts doesn't run. It throws an "Error activating IControllerFactory" exception. ...

ASP MVC Friendly URL's and Relative Path Images

I have an ASP.NET MVC page, where I am trying to show friendly URL's. So, I have a Category View in the Home Controller, that accepts a categoryKey value to get the content of the page. For instance: http://localhost/Home/Category/Bikes gets the bike content. in my Global.asax.cs, i have the following to handle this: public static vo...

Help cleaning up asp.net mvc web.config file

I have finished developing my app and now I want to deploy it.. what changes should I make to this web.config file to make as clean as possible?.. its asp.net mvc 1.0 Thanks in advance <?xml version="1.0"?> <!-- Note: As an alternative to hand editing this file you can use the web admin tool to configure setting...

Where's the DLL for SportsStore.UnitTests???

Hey there SO, I reading Steven Sanderson's book, Pro Asp.NET MVC 2 Framework. I'm on page 116 and I'm running into trouble trying to use NUnit. The book says that I should locate the DLL for SportsStore.UnitTests (one of three projects in the SportsStore solution.) But when i go to SportsStore\SportsStore.UnitTests\bin\Debug\ there is ...

How do I read what is returned via $.ajax()?

I don't receive an alert even though this successfully returns the model I'm requesting? function editaddress(id) { $.ajax({ type: "POST", url: "/Address/Edit/" + id, success: function (msg) { alert(msg); } }); } What is msg? I thought it was maybe a J...

Setting width and height of modal window from JavaScript/JQuery to ASP.NET MVC inline code

This is my HTML ActionLink helper in the view: <%=Html.ActionLink(Resources.Localize.Routes_WidgetsEdit, "Edit", Model.ContentType.ToString(), new {slug = Model.Slug, modal = true}, new { rel = "shadowbox;height=_HEIGHT_;width=_WIDTH_", title = Resources.Localize.Routes_WidgetsEdit, @class = "editWidget" })%> ...