asp.net-mvc

Using Darren Johnstone's Large File Upload Library with ASP.NET MVC Controllers

Darren Johnstone wrote a comprehensive server control and library to upload large files with a progress bar in ASP.NET. I would like to use it with ASP.NET MVC, using a controller method to receive the file, and an Ajax controller method to drive the status bar. I have studied the classes, but am having difficulty getting my mind aroun...

Moving MVC from Dev to Prod causes Parse Error

In moving my MVC app from dev to prod, I get a parse error on the server. The only message I get is the following: Parser Error Message: Could not load type 'System.Web.Mvc.ViewPage<TYPE of View Model>'. Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TYPE o...

ASP.NET MVC: Execute code on all Actions (global OnActionExecuting?)

Is there a "global" OnActionExecuting that I can override to have all my MVC actions (regardless of controller) do something when they get called? If so, how? ...

Constrain ASP.NET MVC Route Parameter Value (Exactly 1 Letter A-Za-z)

How can I constrain an MVC route parameter to be only A-Za-z and exactly 1 letter? (Looking for the validation Regex). Thank you! ...

How to get Html.BeginForm to GET to correct MVC Route

In my ASP.NET MVC application I have the following GET input field: <% using (Html.BeginForm("Search", "Products", FormMethod.Get) { %> <input type="text" name="searchQuery" id="searchQuery" /> <% } % I want this to go to the route: routes.MapRoute("ProductSearchRoute", "Products/Search/{searchQuery}/{pageNumber}", new...

what is the difference between a view model and a data transfer object?

I'm basing this question on Fowler PoEAA. Given your familiarity with this text, aren't the ViewModels used in ASP.NET MVC the same as DTOs? Why or why not? Thank you. ...

It is possible to have different web.config files for a Team Foundation Server project?

Hi folks, I've got a simple ASP.NET MVC website. It has Debug, Testing and Release configuration modes. We're using TFS as our source control and bug tracking, etc. Nice. Now, we're about to embark on using Team Builds to automate some Continuous Intergration. The thing is, we're not sure how to make it so that if we want to make a DE...

Can I disable auto formatting in vs2008?

How can I disable auto formatting for views (html files) in vs2008? ...

how to upload video in asp.net mvc

how can i upload videos in my mysql database using asp.net mvc? view: <form method="post" enctype="multipart/form-data" action="<%=url.action("VideosInsert") %>"> <%Using Html.BeginForm%> <p> <label for="videourl">Browse url :</label> <input type="file" name="video" /> </p> <p> <label for="caption">Caption :</label> <%=Html.TextBox("ca...

ASP.NET MVC posted entity not mapping to LINQ model

I have a page which is strongly typed to my "User" class. When it is loaded, I load it by Id from the database and pass it to the view. When the edit form is posted, the object gets posted to the controller method fine, with some other parameters. The object has its properties filled from the form, but it's ID (which obviously isnt on t...

OnFieldChanging Validation with Linq-to-SQL and MVC

I have the following partial methods in my partial class that is attached to an object in my Liq to SQL model. The first validation check in each method works fine for checking a valid entry in each. However the second if statement is used to check that the user has set at least one of the fields, but the methods are never actually call...

Will_paginate for ASP.NET MVC

I was run across issue to paging my list object in asp.net mvc where my object is simply load by LINQ-to-SQL. Is it some kinds of will_paginates command? in rails, i can do like Users.paginate(:all, :page => 1, :page_size => 20) ...

ASP.NET MVC - NHaml issue on web.config file

Hello There, I'm trying to implement NHaml views on my application, and it's all working well. But strangely I'm getting some warnings on web.config files when publishing the application. My nhaml parameters are: <configSections> ... <section name="nhaml" type="NHaml.Configuration.NHamlConfigurationSection, NHaml"/> </configSection...

Adding jQuery conditional validation to dynamically-generated HTML

I have the following HTML scenario: <div> <input id="txt0" type="text" /><input type="checkbox" id="chk0" /></div> <div> <input id="txt1" type="text" /><input type="checkbox" id="chk1" /></div> <!-- etc --> <div> <input id="txtN" type="text" /><input type="checkbox" id="chkN" /></div> If checkbox N is checked, then textbox...

ASP.NET MVC - Model.OrderBy Date has no effect

Hello, I'm having some difficulties to sort my results by Date. Is there any special method? Because I'm doing this right now: var db = new DB(); var articles = db.Articles; var orderedArticles = articles.OrderBy(a => a.Date); return View(orderedArticles.ToList()); Where Date is a datetime field. And there is no effect for OrderBy(..)...

c# MVC - folder structure - where to put classes?

Hi, In asp/net MVC, the project is divided into Models, Views and Controllers. Fine so far. Say I have a Class 'person', which the people controller populates with data, using the person model. Where is it best to put my person.cs class? In the controllers or the models folder? What do you do? Thanks Frank ...

How can I reload a div with a PartialView in ASP.NET MVC using jQuery?

I have a div with a partial inside somewhere on the page. I have a event on a button. How could i write a Javascript that takes the div and reloads it and also reloads the partial view. I have this in another view. But i can't do it like this now. But i need the same thing to happen only execute by a jquery not directly in the page. C...

Help installing Dynamic Linq extension

Im trying to follow this tutorial and Haack seems to use Dynamic Linq but nowhere can I find how to install it... I know Im supposed to add a reference but Im really clueless in that area.. Im new to this, please help. ...

Where to get Rhino Commons

Hi I'm working on an asp.net mvc project using nhibernate. At the moment I think Rhino Commons session management is the best spproach to control isession. But Where should I get Rhino Commons From? I found it located on Horn, Github, think the svn is obsolete. Please point me to a version that works. ...

Running ASP.NET MVC under Mono/Linux with xsp

I am porting an existing ASP.NET MVC applicationto Mono. I am actually trying to make it run under Fedora Linux 11. After a few tweaks, I have managed to make the solution compile in MonoDevelop. While trying to execute it with xsp web server, I get the following output: Handling exception type ConfigurationErrorsException Messag...