asp.net-mvc

Prevent paste of html page from clipboard into text box in c# ASP

I have a simple web user input form using c#. Users copy what they thin is a screen shot of error conditions to submit as input to the form. The copy action actually captures the HTML of the error page. When this is pasted into my test box I get an error (A potentially dangerous Request.Form value was detected from the client (tbxComm...

ASP.NET MVC - Is it possible to generate cross-application action links?

Hi, is it possible to generate cross-application action links using the HTML helper class? I have the following (both are separate VS2008 projects): http://mainwebsite/ http://mainwebsite/application I would like to generate a link IN the /mainwebsite/application/ project TO /mainwebsite/. Is this possible? Or should I just hardcod...

Learning a bit about some new technologies... any tips?

OBJECTIVE: To learn a little more about some technologies I'm familiar with but not an expert in: Postgres, Compass/Sass, Google Maps API, Twitter API, and ASP.NET MVC 1.0, Flickr API THE SITE: Just a fun little app with CRUD for addresses of my friends, then a page that kind of has a map of where they live, their last five tweets, an...

Custom HttpHandler not firing, returning 404 in ASP.NET MVC Application

I don't know if it is relevant that this is happening in an MVC website but thought I'd mention it anyway. In my web.config I have these lines: <add verb="*" path="*.imu" type="Website.Handlers.ImageHandler, Website, Version=1.0.0.0, Culture=neutral" /> in the Website project I have a folder named Handlers which contains my ImageHand...

Difference between FileStreamResult and FilePathResult?

I have a simple controller which returns images: public class ImageController : Controller { [AcceptVerbs(HttpVerbs.Get)] [OutputCache(CacheProfile = "StationeryImageCache")] public FileResult Show(int customerId, string imageName) { try { var path = string.Concat(Config.ImageDir, customerId, ...

Create a Route Constraint that only applies a route when the action has a particular action filter

I have a list of actions on various controllers that are 'Admin' functions (create, update, delete) but other actions on those same controllers that aren't admin actions. What I want to do is create a route that will prefix /Admin/ before all urls that call an action that have the Authorize filter attribute. Is this even possible to do...

Is it bad practice to return partial views that contain javascript?

Hi, I am implementing a customer database which lets me search for users and companies, browse and edit their details, and many other things using ASP.NET MVC and javascript (jQuery). Whenever a post or get occurs, I do that via jQuery.load and insert the PartialView into the DOM. Some partial views include forms. I want those to be ...

JQuery Autocomplete in Dialog Errors

All, I am using the JQuery Autocomplete Plugin 1.0.2 in a JQuery UI Dialog. Unfortunately, there are 2 scenarios that cause script errors in IE and FireFox. I will be providing FireFox Firebug errors as they are more descriptive. First off, here is the JQuery Autocomplete script which allows for the selection of multiple names: va...

How do I get data out of a state machine workflow before the workflow enters its completed state?

I'm working with a state machine workflow and using the ExternalDataExchange service to handle events in the host and get data into the workflow via eventargs. However, now I need to get data out of the workflow and I'm having difficulties. The outputparameters are only available in the workflow completed event, but my workflow isn't c...

Jquery Dialog and Dropdown Boxes

My dropdown boxes are showing through a jquery modal popup dialog, how do I fix this? I am using IE6 and Jquery 1.3.2 and I have the dialog bgiframe set to true. Any ideas? ...

What is a extensive ASP.NET MVC sample app that uses the entity framework?

Can anyone suggest an ASP.NET MVC sample application that uses the ADO.NET Entity Framework against a many relation sql server database? Most of the sample apps I've seen work against a really simple database with just 2 or 3 tables. I'd like to see the code behind an app that shows more than just the CRUD code to just one table Thanks...

How can I change the way MVC renders an action link dynamically?

I need to change the way MVC is rendering action links(and form's and url's, etc) based on a configuration setting. I am writing a facebook application using MS MVC and my action links need to render link so: <a href="/MyFBApplication/Home/Index/">home</a> clicking the above link would browse to: http://apps.facebook.com/MyFBApplicati...

ASP.NET MVC, MonoDevelop and Windows

According to Miguel de Icaza posts (here and here) and Lluis Sanchez Gual post (here and here) MonoDevelop for Windows will be ready soon. Personally I'm very interesed in using MonoDevelop under Windows for developing open source projects for ASP.NET MVC. Yes, it's better to work in MonoDevelop under Linux but for many reasons I can not...

What's the difference between RouteLink and ActionLink in ASP.NET MVC?

I think that the title pretty much sums it up: What's the difference between RouteLink() and ActionLink() in ASP.NET MVC? i.e. when do you use Html.RouteLink() and when do you use Html.ActionLink() in your View? ...

Using MVCContrib's WindsorControllerFactory with new Windsor Castle 2.0

I'm trying to use WindsorControllerFactory (the latest 1.0.0.916 version) together with the new Windsor Castle 2.0 (again, the latest version). But I'm getting the Could not load file or assembly 'Castle.Windsor, Version=1.0.3.0... error when starting the Web application. Anyway, during writing of this question I managed to pers...

What is a good C# ASP.NET MVC question to ask a prospective employee?

I am about to employ a new programmer for our ASP.NET MVC projects. I put a lot of weight in an interview as to just how much I like a candidate's attitude and how I see them working with, talking to and enjoying being part of the team, but on a more practical note I need to weedle out those who talk a good game from those who actually ...

Ajax query not firing, because it's generating the wrong URL

The following code populates a second dropdown when the first dropdown changes (i.e. cascading dropdowns). However, the Ajax call isn't firing, and I can't figure out why. I'm not getting any syntax or runtime errors. When in debug mode, the GetPlans action is never being called. The inner alert is never called, but the outer one is. To ...

Unlocking asp.net mvc templates in VS 2008

Ok so i downloaded the asp.net mvc through the web platform installer. Rebooted the machine and fired up VS 2008 express. Lo and behold there were no website/project templates that could setup an mvc project. I did a little research and found out they would not show up in the express version. No matter - i got team suite edition too so i...

Can I use [CompressFilter] in ASP.NET MVC without breaking donut caching

I am trying to get [CompressFilter] working with donut caching and running into issues. What happens is that the whole page gets cached and not just the donut. The source for the CompressFilter I am using is below. I changed this from the original source to use OnResultExecuted instead of OnActionExecuting() because I needed access to t...

How do I 'donut cache' in ASP.NET MVC for something more than a date

All the examples for donut caching I've seen are just like this : <%= Html.Substitute( c => DateTime.Now.ToString() )%> Thats fine if I just want the date, but what other options are there? I know there is a delegate 'MvcSubstitutionCallback' which has the following signature : public delegate string MvcSubstitutionCallback(HttpCo...