asp.net-mvc-2

Multi Presentation enterprise solution.

Hi, I am working on designing an enterprise web application which will have single codebase and single database (don't need any flexibility in database based on tenants) but different presentations based on clients. We might have 3 to 4 different clients (websites) utilizing same core logic and skeleton but client specific headers, foot...

ASP.NET MVC: Should I include DataContext files (.dbml and .dbml.layout) in the deployment package?

Hello, Should I include DataContext files (.dbml and .dbml.layout) in the deployment package? Thanks for helping ...

How can I add callbacks to jquery validation (when used in MVC 2)

I'm using jquery for validation in my MVC2 web app (as described here) and I'd like to wire up some callbacks that the jquery validation plugin supports, like invalidHandler, etc. I can manually edit the MicrosoftMvcJQueryValidation.js and add my callbacks (in __MVC_EnableClientValidation, in the options variable) but I was looking for ...

Server Error while file upload in asp.net mvc2

When i upload a file of size 35MB or more it gives Server Error 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. and if i upload a file of size 25MB or less then that it works fine. This issue occurred only when i deploy it on a server if ...

Ajax.BeginForm uploud file inside html.beginform in MVC 2

how can i add Ajax.BeginForm uploud file inside html.beginform in MVC 2 , the problem the ajax form not working . the html.beginform was submited so how can i do that. please Help ...

MVC route with array of homogeneous parameters

I trying to create routes for a resource with an array of homogeneous parameters. URL would look like this: products/category/{categoryId1}/{categoryId2}/.../brand/{brandID1}/{brandID2}/... And would like an action method would look like this: public ActionResult GetProducts(IList categoryID, ILIsts brandID) {...} where category and...

How do I ensure the value of property for others that are dependent upon it?

I have a property like so: private Decimal _payout; public Decimal PayoutValue { get { return _payout; } set { _payout = value; //second part of following conditional is an enum if (Math.Abs(value) > 1 && this.PayoutType == CutType.Percent) { _...

Grouping not working with ajaxically loaded telerik MVC Grid

Hi, i m using telerik extensions for .net mvc. in grid everything is working fine until i try to group the grid control based on some columns. actually my grid is not server bound (even it loads the grid from a partial view using ajax). in this grid grouping causes problems and i get javascript error at a[this.plugins[e]].initialize(this...

Query Entity Framework object and child object with single query

I have two Entity Framework objects with a one-to-many relationship: widget(parent) and widgetNail(child) Widget has a text column: Title WidgetNail has a text column: Description I would like to build a query that will return a list of Widgets that match one of two criteria: A text string is found in the Widget title, or The same t...

Property Injection into an Action Filter

I'm trying to get Property Injection working on a Custom Action Filter Attribute. It is working as it is supposed to, however, I'd like to use DI on the Property itself. My filter looks like this [AttributeUsage(AttributeTargets.Class)] public sealed class HeaderFilterAttribute : ActionFilterAttribute { public IMarketService MarketS...

ASP.NET MVC 2 Submitting a form and a parameter to controller action

Is it possible to submit a form on a view to the controller with a parameter? My controller action is: public ActionResult Index(BusinessObject busObj, int id = 0){ return RedirectToAction("Index", new {businessObj = busObj, search = id }); } I have a submit button, but i also have dropdownlists that post back to the controller s...

Why is the wrong controller being called when I start my ASP.NET MVC2 application?

I have a controller called MetricsController with a single action method: public class MetricsController { public ActionResult GetMetrics(int id, string period) { return View("Metrics"); } } I want to route calls to this controller like this: http://mysite/metrics/getmetrics/123/24h I've mapped an additional route in my Gl...

Trouble Figuring Out The routes.Maproute For This URL (C#)

Despite the plethora of URL routing posts, I have yet to reach enlightenment on the subject. I have an MVC app that works fine, but I want to get fancy and do some URL rewriting to make it easier on my users. The default route is a slight variation on the usual: routes.MapRoute( "Default", "{controller}/{action}/{query}"...

Is it possible to restrict windows authenticated users in an ASPNet app to specific domains?

I'm in the process of pulling a classic ASP app into Mvc2. I'll be deploying to an intranet and have been asked to enable support for Windows Authentication. The network I'll be deploying to has a few AD Domains and I'll only need to integrate with one in particular. Is it possible to use Windows Authentication and only allow authenticat...

Correct Process for Routing with Admin Subsite

I'm building my first Asp.Net MVC2 Site, and i'm now trying to add an /Admin area to the site. I don't want this area to be visibile to the main set of users so will only be accessible when you enter http://Intranet/Admin What I have is a NewsController for my regular users but I also want an Admin NewsController and I'm not sure how t...

Looking for a library to reduce "controller repetition" for CRUD operation in ASP.NET MVC

I am developing the administration part of a site. It mostly consist of manipulating list of data such as: Products Suppliers Tax profiles ... I find the task of creating a controller that handle the CRUD operations of each model a little too repeating and prone to mistake from one controller to another. I would still need to adapt ...

ASP.NET MVC application level soft coded settings

I am working on a ASP.NET MVC 2.0 Multi-Presentation web application which would use a common codebase to support different websites. These websites would differ in following aspects: Each website will have their own headers, footers, images, CSS etc (I guess website specific Master Pages) Some of the UI elements could be different bas...

Viemodel with stored Procedure

I am following the tutorial of scott gu from Here to retrieve the data using stored procedure. i am setting the return type of the stored procedure by dropping the SProc on class. Now my question is that can we set some viewmodel as the return type of the stored procedure, as my view is strongly typed with my viewmodel ...

ASP.NET MVC: generating action link with custom html in it

Hello! How can I generate action link with custom html inside. Like following: <a href="http://blah-blah/....."&gt; <span class="icon"/> New customer </a> ...

PartialView and HTTPPOST action

Hello Everybody, I've a problem with partial view and controller HTTPPOST action : When I'm in HTTPPOST to my partialview, only partial is return, not index page with partialview. I don't understand why! The context : I've an offer(associated with a viewmodel), composed of 4 parts : Client, SwimmingPool, Cover, Resume I would like ...