asp.net-mvc

ViewModel validation object issue with L2SQL generated model class

Hi guys, i'm having issues with implementing a ViewModel class which acts as a wrapper class around a Model class called "User" generated by L2SQL. In short, I have two instances when i have to validate against the L2SQL model. One when the user first signs up, and the second when the user logs in and edits only part of his account data....

SQL Caching and Entity Framework

I have put together a small ASP.NET MVC 2 site that does some very extensive date mining/table-joins/etc. Using MVC, I have a controller that returns the data in many different forms (tables, images, etc). To save hitting the database frequently I have a dual cache mechanism: For identical parameters to the same action I use the O...

Updating viewmodel data in controller doesn't reflect in view's input fields

I have a blogpost edit page where you can either save your edits or upload an image (multiple submits in a single form). When you upload an image, the image link gets appended to a TinyMCE content area. The fields for the form are in a viewusercontrol(shared with create page). Both the viewpage and usercontrol inherit from BlogPost so t...

Routing table is not working

HI I have the following routing table routes.MapRoute(null, "Save", // Route name new { controller = "Package", action = "Save"} // Parameter defaults ); routes.MapRoute( "Package", // Route name "{controller}/{action}/{name}/{p}", // URL with parameters new { controller = "Package", ac...

How can I validate a complex model using ASP.NET MVC 2

Hi have this model public class UserModel { [Required(ErrorMessage = "Le nom est requis.")] [UIHint("String")] [DataType(DataType.Text)] [DisplayName("Nom")] public string Lastname { get; set; } [DataType(DataType.Text)] [UIHint("String")] [DisplayName("Prénom")] p...

Dynamic routes and Membership providers

Using the a Membership provider and the MVC framework, is it possible that routes are dynamically changed so that a already logged in user goes to his own page, rather than the default. At the moment I go to the default. If the user is already logged in or not, there I do a redirect to their own page. This can't be the correct way! Can ...

How to keep data in memory in asp.net MVC2 web app?

I have a MVC2 web app without a database that is being hosted by IIS7. The model is a custom index of some properties of a filesystem, and right now the index is stored in memory. The problem is that on a regular basis, the data stored in memory gets released, and the index must be recreated. Maybe the best solution would be to serialize...

Get list of custom attributes for current action/controller in ASP.NET MVC 1

Checking out the sample code from http://lukesampson.com/post/471548689/entering-and-exiting-https-with-asp-net-mvc written for ASP.NET MVC2, I noticed they can check if a custom attribute is applied to the current action or controller by accessing filterContext.ActionDescriptor and filterContext.ActionDescriptor.ControllerDescriptor res...

Could not load file or assembly 'Microsoft.JScript... or one of its dependencies... what gives?

What does this mean? This only happens on my local IIS where the site used to run fine no problem, it works fine on our DEV/QA servers but on my local machine I'm getting this, what gives? I had no knowledge of us using Microsoft.JScript ever, and doing a search of the project turns up nothing... Could not load file or assembly 'Microso...

Registering more than one VirtualPathProvider

When more than one VirtualPathProvider is registered in the hosting environment, in what order they would be called? ...

ASP.NET MVC ActionFilter

Does anybody knows if the OnResultExecuted method from ActionFilterAttribute class is executed even in CATCH block? ie: [CookiesActions] public ActionResult Login(Usuarios usuario) [...] return View(new UsersViewModel(sceUsuarios.Usuario,true)); } catch { r...

how do i pass value to controller

I have a drop down where I want to pass the selected value I selected to the controller. How do I accomplish this? ...

does a action filter override a controller filter?

does a action filter override a controller filter? ...

ASP.NET MVC return ViewResult

I trying to return a ViewResult in OnActionExecuted method override from ActionFilterAttribute class.Like below: public override void OnActionExecuted(ActionExecutedContext filterContext) { if (CreateCookie && filterContext.Exception == null) { LoginCookies lcookie = new LoginCookies(usuDs, usuSenha); ...

The new ViewModel doesn't obsolete the ViewModel pattern in ASP.NET MVC 3, right?

In my understanding, the ViewModel pattern was designed to pass all the relevant data to View because 1) the view shouldn't perform any data retrieval or application logic and 2) it enables type-safety, compile-time checking, and editor intellisense within view templates. Since dynamic expressions are defined at runtime, does this mean ...

How can i automatically update a field before saveOrUpdate with Sharp Architecture

Lets say i have this entity public class Address : Entity { public Address() { ModifiedDate = DateTime.Now; } [NotNull] public virtual Province Province { get; set; } [NotNullNotEmpty] [Length(Max = 80)] public virtual string Line1 { get; set; } [Length(Max = 80)] public virtual string ...

ASP.NET MVC View/Site Design

Hi All, This stems from my question that i started at http://stackoverflow.com/questions/3561898/mvc-beginner-question Im now confident in developing a MVC website from the MVC side of things. My fatal floor now is the UI level designing. i.e. designing views and master pages including css styling. Just wanting to get any advice on ...

How to reset ASP.NET Startup page?

I've accidentaly clicked "Set as Startup page" on Index.aspx of ASP.NET MVC application. Now every time I click Debug, it starts here: http://localhost:5577/Views/Home/Index.aspx Which obviously gives me an error. Can i revert the startup page back to the original http://localhost:5577? ...

How to call an external URL from a ASP.NET MVC solution

Hello guys. First post inhere ever. So better make it a good one. I have a ASP.NET MVC 2 web application in which I have an actionResult I need to do a call for me. The thing is I need this A.R to handle some data operations and after that I need it to call an external URL which is actually a Company Module that handles sending messag...

Adjust parameter name in controller action to map HTTP request parameter

I have the problem that I must map a fixed URL parameter that contains an underline (e.g. purchase_id) to an controller. public ActionResult Index( long purchase_Id, That is working, and it's not my problem. The thing that annoys me, is the underline in the parameter name, due to the fact, that I can't change the given U...