asp.net-mvc

Too fast response

I have an ASP.NET-MVC application that: opens a db transaction updates a cart status and other things submits this cart to another web server via an HttpRequest register in database the transmission with its code status send a confirmation mail, that the command has been sent then if no error has occurs commit the transaction else roll...

restart of web dev server every time load ASP.NET MVC application

Hi, I continously get this problem (stack trace below) when I start my ASP.NET MVC application and have to restart the web dev server and then it goes away. It appears to be happening on when I make modification in my jquery and then try to restart the application. protected void Application_Start() { InitialiseIoc...

Where to store different computation rules in web application

Hi all, I'm writting a web application using MVC and Linq2Sql. Theie are a set of questionaires having different versions. Each version questionaire have different rating rules for the questions in the questionaire. For example 1.0 version may let question 35~ question 100 tobe 1' but in 2.0, they are 1.5'. How can you store that rules ...

Create, Approve, Edit, Approve pattern for site content

I'm working on a modification to a site to allowing users to enter content. However, once they've created that content it needs to be approved before it can be published. This is fairly easy to achieve by having a "moderate" bit set in the record for that content and only one table is needed. Now I also want to allow users to edit the c...

How to test this simple controller / view?

I have a really simple action in a controller that simply returns a view which only contains html. public class TestController : Controller { public ActionResult Index() { return View(); } } How can I make sure that the view renders without an error? When I execute this: UsersController controller = new UsersContro...

What information should/shouldn't an error page display in a web application?

I'm developing a number of error views for an ASP.NET MVC application (a not-found, unknown and general error view) and I'm curious to know how others would answer these questions: What kind of verbage do you include on these pages? What kind of information do you display to the end user? What information do you log? I don't think th...

best url for heirarchical data crud operations

I have 4 one-to-many relationships in a row so that each entity essentially has a parent entity. What is the best way to do this. Heres what i have so far? for the entities - Items -> Gallery -> Image -> Image Properties The url for items is easy item/list for the gallery though it could be item/gallery/1 for the gallery list o...

Asp.Net MVC - Mixed Auth Mode

I'm looking for the most reliable way to use both Windows and Form based auth IN ASP.NET MVC 2 I know how to do it in webforms, but because I cannot adjust the permissions (In IIS) on a per file basis in MVC. Im struggling to transfer the concept. Any suggestions? Links? ...

is it possible to do this without using an "if" (asp.net mvc post action method)

according to anti-if campaign it is a best practice not to use ifs in our code. Can anyone tell me if it possible to get rid of the if in this piece of code ? [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(OrganisationInput organisationInput) { if (!this.ModelState.IsValid) { return View(organisationInput...

ASP.NET - accepting terms of use

I am writing ASP.NET MVC application. When the user first logs in, the application should display a page for his acceptance of the Terms of Use. If the user does not accept the terms, he will be redirected to log in page. If he accepts the Terms, then he can continue using my app. Where is the best place in the application where I can ch...

other ways to write this markup

Hey All, <% if (isTrue){ %> <div id="myResults" style="display: none;"> <% } else { %> <div id="myResults" > <% } %> Is there another way to write the preceding? The only difference is displaying it or not based on a condition. Thanks, rodchar ...

Get form-values from HTTP-get?

I'm using ASP.NET adn have the following code in my view: <% using(Html.BeginForm("Search", "Home", FormMethod.Get)) { %> <%= Html.TextBox("searchText") %> <input type="submit" value="Search" /> <% } %> and in my controller I have: public ActionResult Search(string searchText) { return View("Index"); } If I hav...

ASP.NET MVC Hierarchy Url Routing

Hello, I have a problem My route have an extra paramater after hierarchical category. /2009/World/Asia/08/12/bla-bla-bla asp.net mvc does not support this because my routing should be {year}/{*category}/{month}/{day}/{name} i tried use constraint like year = @"(\d{4})",category = @"((.+)/)+", month = @"(\d{2})", day = @"(...

How Can I Assign an Expression To a Model Property Then Use It In a Partial For an ActionLInk?

Is it possible to assign an Lambda Expression (action?) to a property of my View Model, then use that expression in a Partial? What should the model's property type be? Psuedo Code: View Model public class MyModel { public ????? MyAction {get;set;} } Controller public ActionResult Index() { var model = new MyModel(); model...

Setting Value Html Attribute For Html.TextBox (MVC 1.0)

I'm creating an Html TextBox via HtmlHelper and I can't get the value attribute set. I've tried both of the lines below and I have also googled but cannot find a solution: <%= Html.TextBox("name", null, new { @class = "textbox", value = "hi" }) %> <%= Html.TextBox("name", null, new { @class = "textbox", @value = "hi" }) %> Both lines ...

ASP.NET MVC Two Way Data Binding of Model to Radio Button List using Typed Model.

I have a mvc view made up of a matrix of radio buttons. Each row of radio buttons is in a group and represents a typed object from the model. Using the guidance of various blogs and postings I have successfully bound the posted form results to the typed model array in the controller action, however cannot seem to successfully reverse t...

Can I substitute MVC Routing for legacy WebForms URL Rewriting?

I'm currently migrating a large website from WebForms to MVC. It's going to be a long process, I can't go through every page and migrate it right away, nor do I want to. One of the issues I have is, in the old web app, we were doing some URL Rewriting for the WebForms stuff like so: from: http://sample.com/id/123/name/Something/Page.as...

asp.net mvc: Paging - Setting Prev/Next page values in ActionLinks?

I'm trying to implement some simple paging, based on http://stackoverflow.com/questions/446196/how-do-i-do-pagination-in-asp-net-mvc The paging works fine. However, I'm now trying to create previous and next links, but can't figure out how to access the params: My route looks like: routes.MapRoute( "Name", "Controller/A...

Best Practice for Asp.net MVC Resource Files

Hi all, What are the best usage of the following resource files. Properties -> Resources (Phil used this resource for localization in DataAnnotation) App_GlobalResources folder App_LocalResources folder I also would like to know what is the difference between (1) and (2) in asp.net mvc application. Thanks, Soe Moe ...

ASP.NET MVC project to port

Is there a project out there that attempts to replicate or re-create a portal framework like DotNetNuke using MVC framework ...