ASP.NET MVC 2 controllers and actions use UpperCamelCase.
For some reasons many big sites, including SO, use lowercase (with underscore) for controllers and actions in the urls. Examples:
http://stackoverflow.com/questions
http://stackoverflow.com/users/377920/randomguy
http://www.reddit.com/ad_inq/
http://www.wired.com/special_multime...
Hi,
I'm working through the MVC Music Store in Visual Basic (mvcmusicstore.codeplex.com), trying to convert things as I go. I'm heving trouble with some of the lambda expressions in the Views, however. Specifically, on page 53 when the Album editor template is used, I am not seeing my editor template when I use the following code:
Orig...
Hi,
I have the following EditorFor template:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<ContactDto>>" %>
<%@ Import Namespace="c2.bases.dto.structure"%>
<%
for (var i = 0; i < ViewData.Model.Count; i++)
{%>
<%=Html.EditorFor(x => x[i])%>
<%}
%>
The problem is that it is not generating...
I am using ASP.NET MVC2 for my project. I want to send the user confirmation messages after actions.
Ideally:
User clicks on a link with a query string (i.e. a link to delete an entry)
The controller does what the link says, creates the success message, and uses RedirectToAction to get rid of the query string from the URL.
The new actio...
I'm trying to add a View to an arbitrary folder in my MVC project (~/SomeOtherViewDirectory). This works fine until I modify the View to use be strongly typed.
Ie, if the page inherits from System.Web.Mvc.ViewPage, it compiles and runs fine, but if it inherits from System.Web.Mvc.ViewPage it does not. When I turn page compilation on...
I have an index page which shows a paged list of data from a database. When that list is empty, I want to show a "blank slate" view that clearly indicates to the user where they are and what they can do there: "You can add a new item by clicking here" type of thing.
Is there a better/cleaner way to do this than just having a big if stat...
We are upgrading some of our VS2008 solutions to VS2010, but we are not yet prepared to go to .NET 4.0 on all our projects. At the same time, we are looking at a move from MVC 1.0 to 2.0. I know that there are MVC 2.0 assemblies/code compiled against both the 3.5 and 4.0 .NET Frameworks, but will these two MVC versions live side-by-sid...
I am currently working on a website using MVC2 and using ASP.NET Ajax to handle moving between pages. Everything is working fine except a page that has a form for the user to fill out that uses DataAnnotations for validation. This form falls within my UpdatePanel and won't conduct server or client side validation, both which I have worki...
I'm building an ASP.NET MVC 2 site, where I want to have users verify their email address after they register.
I want to send an email to the address with a link that the user can click to verify their email, and then handle the clicking of that link (the link will contain a specific id, of course).
Of course, this is easy to manually ...
I am uploading files using SWFUpload. To get the data I need passed along with the file, I am adding post params to swfupload. The problem is that the custom model binder I have written is not called when the controller method is called by swfupload. Some of the properties of my model are set, but not the properties controlled by my c...
I have a custom Data Validation Attribute I've created to make sure the passwords a user inputs are the same, but IsValid is never invoked.
Custom attribute:
public class IsSameAsAttribute : ValidationAttribute
{
public String TargetProperty { get; set; }
private readonly object _typeId = new object();
public IsSameAsAtt...
I've been thinking about this recently and I don't know a really nice and tidy way of creating a mobile version of an existing or new MVC2 website/app.
I think the easiest way would be to just use a different stylesheet depending on whether a mobile was detected but sometime you need to change the view content too if you have massive in...
I am planning to use MS Ajax Minifier with Asp.Net MVC 2.0 for handling the Js and Css files. Does anyone has experience with MS Ajax Minifier? I have following questions regarding this.
Is it the best way to use JS/CSS files in Asp.Net MVC or is there a better way. E.g. YUI Compressor, Telerik Extension for MVC?
As I understand we ca...
hi!
i would like to change the way LabelFor render. Can i do that with a DisplayTemplate?
LabelFor generate a label tag and i would like to add a ":" at the end of the label.
thank you!
alex
...
My MVC validation is failing on disabled form fields - saying that they are required, even though these disabled input fields have values set.
I read this http://weblogs.asp.net/imranbaloch/archive/2010/06/20/disabling-client-side-validation-for-disabled-input-controls-in-asp-net-mvc.aspx which explains how to modify the MicrosoftMvcVal...
I use this in my Index.aspx:
<%= Html.StandardOverlayCreateButton() %>
<div class="apple_overlay" id="overlay">
<div class="contentWrap">
</div>
</div>
Which is translating into this:
<a href="Employee/Create" rel="#overlay"><button type="button">Create</button></a>
<div class="apple_overlay" id="overlay">
<div class="con...
I am creating a .NET MVC (1.0) facebook application using FBML. Everything is working like expected. However, if I simply change the project to reference the System.Web.Mvc 2.0 assembly, the application stops working. No exceptions are thrown (it makes it through the controller class fine) but nothing is rendered on the page? Any ide...
How do I make my application route to mydomainname/username/controller.
I am working on asp.net mvc web application that enables a user to belong to multiple account. ie. In the application every account has its own users, and each user in one account can also be a user in another account. What i need is when a user wants to login, the...
Hello SO Community,
I've been using Html.Action("ActionName", "ControllerName") to invoke child actions across controllers without needing to have the view in Views\Shared. This has been working great for displaying things like session or cookie information.
Instead of just accessing cookies, I would like to pass additional parameters ...
ViewData.Model.ExecuteResult does not exist in ASP.NET MVC2, but in MVC1.
What is the alternative in ASP.NET MVC2?
What I want to do, is to update a table after an ajax request. So I put the table in an extra View. How can I update this partial view without loading the whole page again?
...