asp.net-mvc

ASP.NET MVC - Can i have multiple names for the same action?

ASP.NET MVC - Can i have multiple names for the same action? In the same controller... Can i have multiple names for the same action? I am looking for a complete multiple language solution. Essentially the i want all the logic to be sa same but change the "keywords" (actions, controllers in the url) depending on language. ...

What am i doing wrong with this in asp.net-mvc?

I gave this in my site.master <li><%= Html.ActionLink("Material", "Index", "Material")%></li> But my link doesnt seem to get my material controller Index method... I have this in my global asax file, public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ...

ASPNET MVC what do you call this, a partial view? Or something else?

I'm trying to google for info on a situation, but I dont know what it is called, so its hard to find results :) I have a model with say 10 fields. But only some of those are shown on a particular view, lets say 3 of them: id, name, date. What do you call this kind of view that does not display the whole model? A partial view? The pro...

Using T4MVC in real project

T4MVC is cool, but I have a couple of issues integrating it in my project, any help is really appriciated: I've got such warnings for all my actions (I use SnippetsBaseController as base class for all my controller classes: Warning 26 'Snippets.Controllers.ErrorController.Actions' hides inherited member 'Snippets.Controllers.Base.Sni...

MVC Paging and Sorting Patterns: How to Page or Sort Re-Using Form Criteria

What is the best ASP.NET MVC pattern for paging data when the data is filtered by form criteria? This question is similar to: http://stackoverflow.com/questions/1425000/preserve-data-in-net-mvc but surely there is a better answer? Currently, when I click the search button this action is called: [AcceptVerbs(HttpVerbs.Post)] pu...

server side control in MVC

can we use server side controls in MVC, if no then why server side control list appears. ...

MVC - Loading DLL programmactically

I'm trying to implement a plugable architecture in asp.net MVC. I have based my modules on the following article - http://www.wynia.org/wordpress/2008/12/aspnet-mvc-plugins. I have a DLL that contains a simple controller, and a view. The view is an embedded resource within the DLL. The problem I'm having is, if I drop the DLL in the bi...

Putting logic in ViewModel get'ers

What do you think about putting Get-logic in the getters of a ViewModel? Something like: public class DummyViewModel { public int Id { get; set; } private DummyObject myObject; public DummyObject MyObject { get { if (MyObject == null) { DummyRepository repo = new ...

filtering problem in LINQ

var query = from d in testPersons.person where d.Name == txtbox select d; txtbox is text box on View page. How change this code to return all names who starts with any part of name? For example: When I type R in text box, on View page, this query should return all names who is start with character R ...

use of Areas in MVC2

what is the purpose of "Areas" in MVC2 ...

How to programatically record the start and end of an MVC FileResult for logging of incomplete downloads?

Hi, I have been investigating how My ASP.NET MVC application can log unsuccessful / incomplete downloads. I have a controller handling the file requests which currently returns a FileResult. What I need to record is the IPAddress, filename and when the download started, then the same data and when it completed. I have looked at intercep...

Data Annotations for validation, at least one required field?

If I have a search object with a list of fields, can I, using the System.ComponentModel.DataAnnotations namespace, set it up to validate that at least one of the fields in the search is not null or empty? i.e All the fields are optional but at least one should always be entered. ...

Handling checkbox in asp.net mvc

Hi, I want to store checkbox value to database by selecting the particular checkbox in asp.net MVC.I mean we check the checkbox and then click save button and the value saved in database.How is it possible. Kindly help me... Thanks. ...

Binding Entity Framework Collections Simply Using ASP.NET MVC

To begin with: Using Entity Framework v4.0. ASP.NET MVC 2.0. Visual Studio 2010. I have a model that consists simply of an order & order items. What I want to do is simply bind that model without too much hassle where possible (avoiding type converters, etc). Simply the model looks like this: public class Order { public int ID { g...

using WCF in asp.net MVC

can we use WCF in Asp.net MVC and how can we use? ...

Difference between Asp.net MVC 1 and Asp.net MVC 2

What is difference between Asp.net MVC 1 and Asp.net MVC 2? ...

ASP.net mvc 2 solution folder structure

What is the best way to organize a MVC2 web project (as complex as stackoverflow)? should i have everything in one project? if not, how should i separate the projects and folders? ...

Ninject - Asp.net Mvc: Multiple projects in solution

Hello, I was trying Ninject in a Asp.net Mvc application and I was wondering what the best practice is for using Ninject if you have more than 1 project in your solution. I guess all projects need some kind of Loader which you initialize in the global.asax? Kind regards, Pickels ...

Find Javascript Code inside String

Greetings friends, I am developing a web application that will allow the customer to enter a personalized message, which will then be converted to HTML. Well, the problem is that I can not allow the insertion of Javascript code. So I need a method that filters the text, searching for and remove it. I think the regular expressions to so...

how create a Controller partial class to override OnAuthorization?

I'm trying to change the method OnAuthorization, so that it is available for any application ... this way: public partial class Controller { protected override void OnAuthorization(AuthorizationContext filterContext) { if ((string)(filterContext.RouteData.Values["action"]) == "test") { filterContext.R...