asp.net-mvc-2

missing ) after argument list error when using Ajax.ActionLink mvc2

I've got this actionlink that is generating this error in firefox <%: Ajax.ActionLink(" ", "SelectEditProduct", new { id = item.Id }, new AjaxOptions { UpdateTargetId = "dialog", InsertionMode = InsertionMode.Replace, OnSuccess = "$(\"#dialog\").dialog(\"open\");"}, new { Class="edit"})%> It seems to be coming from the little javascri...

Register routes using a bootstrapper fails with VirtualPathProvider exception

I am trying to abstract out the route registraion process out of global.asax into a bootstrapper. My class looks like: public class RegisterRoutes : IBootstrapperTask { private readonly RouteCollection routes; public RegisterRoutes(RouteCollection routes) { this.routes = routes; } public RegisterRoutes() : ...

ASP.NET MVC 2 Numeric value validation

I have this property on a class: public virtual decimal? Number { get; set; } When I'm using it on a form, MVC validates it automatically. If the user enters a letter, naturally an error is returned: "The value 'D' is not valid for Number." How do I change such error message or even control that behavior? I'm not finding the related...

How to expose WCF4 metadata endpoint in ASP.NET MVC 2 app

I have a ASP.NET MVC 2 application with WCF service defined in it (.svc file using service from a different project). web.config WCF section looks like this: <system.serviceModel> <behaviors> <endpointBehaviors> <behavior name="RecordServiceAspNetAjaxBehavior"> <enableWebScript /> </behavior> </endpointBehaviors> <se...

XSLT vs ASP.NET MVC framework

Hello, I am in the process of building a very scalable website. I am to the point where I must choose between XSLT and using the asp.net MVC framework and the helper functions. My data is already in XMl format and it will stayy that way. The reason my data is in XML format is because it will be much easier to make changes and I will only...

Get PartialView action and controller responsible for the post

I have a PartialView, on a form that does an ajax post. All my controller's inherit from a base controller that has a property on it "ReferringPartialView". I need to somehow set that property and allow a user to make use of it in the post action. I figure i need to override "OnActionExecuting", so i have done so, but no where can i fi...

How to render asp.net mvc controls in XSLT

I would like to use the asp.net mvc actionlink and form controls in xslt code. How do I go about doing this? is this notpossible to do in xslt? I could not find a solution online. ...

Map From ValueProvider To Model In BindModel?

In an MVC2 app, I have various controller methods that will be handling incoming JSON data. I created a custom JSON ValueProvider that parses the data and makes the data available for binding. I'd like to have various controller methods have as param type an (Edit/From/Whatever) Model to which to map the parsed JSON values. I have adapt...

Retrieving the listbox values from a modelpopup partial view in asp.net mvc2 using fluent hibernate

i am having tow list boxes in a modalpopup window. In the first listbox i am storing all the availble products.the other list box will be initially empty. using couple of buttons i can pass listitems between the listboxes. my problem is when i assign some listitems to the second listbox. i cannot get them back go the controller as a part...

What is a reliable way to run time consuming tasks in ASP.NET MVC2

I need reliable way to run 10 different tasks simultaneously. For instance the first one would be sending emails, while the next one is cleaning rows from a specific table... so on an so forth. I've used the Thread class and while it works well on my development machine (VS2010 internal web server) non of these threads seems to be worki...

how create asp.net mvc custom model validation that is working with 2 or more field

I need following attributes: 1.For example: i have 2 field. first is checkbox, second is textbox. If first control checked. second field must be Required attribute. first control unchecked. second control not required. [Required] public boolean showHeader{get;set;} [IFRequired("showHeader",true)] public string HeaderText{get;set;} 2...

Not sure how to get dropdown values from view model

Hi, I'm not sure how to get ALL of my values from the view. I am using a strongly typed view model called ApplicationViewModel, here is the code: public Application Application { get; private set; } public SelectList AccountTypes { get; private set; } public ApplicationViewModel(Application application, IEnumerable<AccountType> acco...

Shared 'per request' storage for ASP.NET MVC controllers

In a standard ASP.NET webforms project, if I have a several user controls on a page that require the same data I'd tend to have the first user control put the data in the HttpContext.Current.Items collection so it was available for all the others. What's the nearest equivalent to this for a ViewResult on an MVC controller that's used mu...

Dynamic markup with MVC

Hi all, I have markup stored in a database, which I am pulling out and placing onto a page. below is a basic sample of what I have, without any db calls for ease of example; The controller: ViewData["testMarkup"] = "I was here <%= DateTime.Now.Year %>"; The View: <%= ViewData["testMarkup"] %> now this out puts: I was here and no ...

ModelState is false even though client-side validation passes

Hi, I have a strongly typed view model. I'm using MVC 2 and EF4. When I click the submit button, front end validation passes and it goes into my Create action, and for some or other reason my ModelState is false. Not sure why. So I added the following line of code to see the errors: foreach (var modelStateValue in ViewData.ModelSta...

Reasons why FireFox would cause a Classic ASP + ASPNET MVC 2 site to consume maxi RAM + CPU on server?

I recently inherited a dinosaur Classic ASP site that has some fresh blood pumped in to it in the form of intertwined ASPNET MVC 2. I have duplicated the site on the same server (Windows 2008 R2, 4GB, quad core, vm) to setup a poor man's staging site. As we were trying to sort some legacy bugs in the Classic ASP admin module we noticed t...

How to use resources for globalization in asp.net mvc ?

Hi all, I have an application which will be used by multiple companies.So my views/pages are being accessed by all these companies and each company will have their respective content... for e.g. there are 5 titles so each company will have their own titles on each page. So , I am using different resource files for each company and changi...

Castle Windsor: master controller not resolving the registered components in the container

Having the code below in my Global.asax.cs and two controller (one based on a the other: MasterController) I don't seem to find how can I resolve the repository register in my WindsorContainer from the MasterController... the same applies in the HomeController and works perfectly... what am I doing wrong? Global.asax.cs: private IWinds...

Changing Json output ASP.net MVC

Hi, I have a ASP.net MVC application that gets marker coordinates from a database (I use ActiveRecord) and outputs them as json to be used in google maps. The format however is not quite right. Does anyone know how I can change the output? Currently the output is: [ { "Id": 1, "Name": null, "Location": "13....

ASP.NET MVC Session Timeout and TempData

Hello everyone, I have an ASP.NET MVC2 web application that uses InProc sessions to store the logged in user's ID. In the controllers, I am using a custom AuthorizeAttribute to check the Session for a valid ID. I am also using TempData within my controllers after a GET->POST->REDIRECT to display confirmation messages. For example, when...