asp.net-mvc-2

Bin Deploy MVC 2.0 site to IIS6 with .Net 3.5 SP1

Hi guys, I've built an ASP.Net MVC 2.0 site in VS2010, targeting .Net 3.5. I'm trying to 'bin deploy' to a server running IIS 6.0. The server is a 'test' virtual server running Windows Server 2003 R2 64bit, and .Net 2.5 SP1. MVC has not been installed on this server. I am trying to replicate the hosting environment where this applicat...

Stop the tag builder escaping single quotes ASP.NET MVC 2

Hi, I have the following HtmlHelper method that I want to create a button that does a redirect with JavaScript: public static string JavaScriptButton(this HtmlHelper helper, string value, string action, string controller, object routeValues = null, object htmlAttributes = null) { var a = (new UrlHelper(helpe...

How and Where to store search parameters in MVC application

I am working on a railway web application and I have following layers: ASP.NET MVC 2 (Presentation Layer) Services Layer Repository Layer Database & External Web Services as data sources (Using Entity Framework for Database) I pass Domain Entity Objects from Repository to Service layer and thinking of passing View Models from Service ...

Http post request not being noticed on MVC ASP.NET Deployment

Hi, I have two an action method - > RoleURLManagement which differs with its input parameter in the get compared to the post so we have [AcceptVerbs(HttpVerbs.Get)] public ActionResult RoleURLManagement(string id) { } and [AcceptVerbs(HttpVerbs.Post)] public ActionResult RoleURLManagement(aspnet_Roles r...

Asp.Net MVC - Update live Web site

What is the best way to update a live Web site created with Asp.Net MVC 2.0 ? Using the app_offline.html used in Asp.Net ? Other new way ? ...

Replace Ajax.ActionLink output to use Jquery

Is there an easy way of replacing the generated output of Helper function Ajax.ActionLink to use Jquery instead of MS ? Or must i do all the job in a custom Extension? Someone must have done this EDIT: I think i'm looking at replacing the MicrosoftMVCAjax.js with something done with JQuery. Something called JQueryMVCAjax perhaps... ...

ASP.NET MVC 2 wildcard route has trouble handling spaces

I've got a wildcard route mapped as below: routes.MapRoute( null, "{controller}/{action}/{*category}", new { controller = "Mall", action = "Index", category = UrlParameter.Optional } ); This has been working fine until the category has any spaces before or after slashes " / ". For t...

What's the current practice for partial caching in ASP MVC2?

My website pages are composed of two kinds of content. The first is variable between users but constant for all pages. The second is constant across users, but variable between pages. This is a common layout. What is the best way to apply output caching to content like this? As I understand it, the Html.Substitute helper is incompatible...

Passing HTML Attributes and [DisplayFormat] using Html.EditorFor and Html.TextBox

I am trying to use Html.EditorFor for a value where I need both a DisplayFormat attribute and an HTML attribute (specfically a CSS class) to be applied. Html.TextBox ignores the DisplayFormat attribute, and Html.EditorFor will not let me pass Html attributes. Other than writing the HTML myself, what is the preferred solution here? ...

DefaultModelBinder not binding nested model

Looks like others have had this problem but I can't seem to find a solution. I have 2 Models: Person & BillingInfo: public class Person { public string Name { get; set;} public BillingInfo BillingInfo { get; set; } } public class BillingInfo { public string BillingName { get; set; } } And I'm trying to bind this straight into my ...

Asp.net Mvc Display template of String, but now every simple type wants to use it!

I created a Display Template which when passed a string renders a disabled text box <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<String>" %> <%: Html.TextBoxFor(model => model, new { disabled = "disabled" })%> Which works great. However, for some reason MVC wants to try and stuff DateTimes and Ints through it as...

Strange problem Ajax enabled MVCContrib Grid pager

Hello, Let's explain the context: I have a person form inside a jquery dialog that has some tabs to group informations related to this person (Personal data, addresses, emails, position, etc.) One of the tab show the Person addresses through an ajax call to this controller action [HttpGet] public ActionResult GetAddresses( int id, int...

Display data in a 2 column Table

hi, i'm new to asp.net mvc. I'm displaying data from a linq to sql query but unsure how to render a a list of data in a 2 column table. eg. A list of products. I've seen this example, but wondering if there are any other suggestions - http://haacked.com/archive/2010/05/05/asp-net-mvc-tabular-display-template.aspx. Hence if i have 6 pr...

Background image isn't rendering in the web browser.

Hi guys, I'm trying to repeat an image I have by x and y, using repeat-all. The image isn't displaying. Here is the CSS code: body { background-image: url('Content/images/test.png') repeat-all; } I'm sure the CSS file is linked correctly, here is the Content folder of my application: Any help? ...

Entity Framework 4 , Extending context of one edmx file to a context of another edmx file

My Question is can we extend one context to another in Entity Framework 4. Following is the problem background. I am using EF4 for developing a Web-Application. My Web Application has 3 projects. One project is for storing candidate CV information. Another project is for storing customer information. Final project is called CORE. t...

asp.net mvc 2, select content by routing string

Hello! I am having trouble to what i should name this in the title field... Question is. I want to select a blogpost by entering its title, like this: http://localhost:3254/blog/2010/10/net-programming The title of the blogpost should be ".net programming". So i have setup a route to look for a year a month and finally a string. But h...

Adding validation to a Dropdownlist in a EditorTemplate

Hello, I am trying to find a good way to have a dropdownlist by specifying UiHint "DropDown" to the property of the ViewModel and then just using HtmlHelper EditorFor to render the dropdown via an generic EditorTemplate so that it can be used across solutions. I found a very good approach by Tom Schreck Here It works fine. The only thi...

ASP.NET/ MVC/ C#/ Jquery/ creating a CMS front end and PDF Generator

Hi, I have a few general ideas on how I want to do this, but any help/ guidance would be greatly appreciated... What I am trying to do is: create a front end cms system, VERY, VERY SIMPLE where a report will be generated from i.e. a template, using jquery (drag, drop etc), included in the report will be placeholders where data will be i...

ASP.NET MVC how to make an action that return a file?

Hello I am generating an excel file inside my action that I would return to the user. How do I have to declare the action to return a file? May I call this action with ajax? thanks! ...

Help with ASP.NET MVC 2 Routes

Is there any reason why a route would be properly mapped in one environment and not another? I am deploying the exact same routing information from my local development server to a production server, and the routes are not being evaluated the same. I have downloaded Phil Haack's Routing Debugger, and it is confirming that the routes ar...