asp.net-mvc

MVC Framework Browser Caching Issue with RC1

In my latest project which is in RC1 I have noticed that I have this browser caching issue that I just can't shake. This is what my header looks like HTTP/1.1 200 OK Date: Tue, 03 Mar 2009 15:11:34 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 X-AspNetMvc-Version: 1.0 Cache-Control: private Expires: Tue...

OutputCache Bug with VarByParam="None" with MVC RC refresh

Came across to this defect with ASP.NET RC refresh while using VaryByParam="" instead of VaryByParam="None". Caching WORKS, but page http://www.yoursite.com and http://www.yoursite.com/home/index will be cached separately it seems. What is the difference between VaryByParam="" and VaryByParam="None"? edit : I mean VaryByParam="" not ...

OutputCache and RenderAction cache whole page

I have a ViewPage that contains <% Html.RenderAction<MyController>(c => c.SidebarStats()); %>. On the controller action for the action SidebarStats I have an OutputCache action filter to cache only that part of the page. However, the whole page is getting cached and not just that action. I remember seeing somewhere that this might be ...

Support for optgroup in dropdownlist .NET MVC?

Continuing on from this question programmatically creating a drop down list I would like my list to have several optgroup lists too. Is this currently possible? I know I need to pass a selectList to a dropDownList but do not know how to add text,value,optgroup to the selectList. I want the end result to produce: <option value="">Pleas...

How to handle stackoverflow's question urls in an asp.net mvc controller?

I would like to know how to set up the routing in asp.net mvc so I can have similar urls to stackoverflows question urls? http://stackoverflow.com/questions/115634/do-you-believe-that-asp-net-mvc-is-ready-for-production/ I am guessing that for url creation there is a helper class that creates the question urls. The part i am wonder...

Problem installing OpenID on ASP.NET MVC Site

I am trying to install openID into my web site project that is using ASP.NET MVC, specifically with Yahoo Yahoo keeps giving me this : "Warning: This website has not confirmed its identity with Yahoo! and might be fraudulent. Do not share any personal information with this website unless you are certain it is legitimate." However I hav...

Shorthand for creating a ViewDataDictionary with both a model and ViewData items?

Is there any way to create a ViewDataDictionary with a model and additional properties with a single line of code. I am trying to make a RenderPartial call to a strongly-typed view while assembling both the model and some extra display configuration properties without explicitly assembling the ViewDataDictionary across multiple lines. It...

Calling another controller action after the current controller action has finished executing

What I am trying to achieve: After each view has finished executing I would like to make a separate http call to an external partner. I need to pass one of the view's content as body of that http call. What I have so far: I have a base controller from which all of my controllers inherit from. I have found that i can override the ...

HandleError Attribute not following Order

I have a base controller with a HandleErrorAttibute decorating the class declaration like so: [HandleError(View="Error", Order=1)] public class BaseController : Controller If I put [HandleError(View="DifferentError", Order=2)] on a subclassed controller method and an exception occurs, I get the Error.aspx rendered view. I expect t...

What website hosting is good for ASP.NET MVC?

Duplicate: Can you recommend good hosts for ASP.NET? Shared IIS7 hosting? My website has been created entirely using ASP.NET MVC does anybody know the best hosting service for it? ...

Javascript files not mapping correctly in ASP.NET MVC?

I am having an issue with my javascript files in a master page ... I have the following: <script src="Scripts/jquery-1.2.6.min.js" type="text/javascript"></script> <script src="Scripts/Plugins/jquery-corners.js" type="text/javascript"></script> This works ... until I start to go deeper into the r...

What advantages are the of using .resx localization for an ASP.NET MVC app?

There are a number of questions on this site related to how to access RESX files in an ASP.NET MVC application, and best practices of using them. However after reading (for the first time I might add) the MSDN article on resources I'm left wondering if there are even any advantages of using RESX files since I'm not going to be using ser...

ASP.NET MVC passing complex type into controller problem

Hello, I have a problem passing in a complex type into a controller. Here is how my Model looks like: public class Party { [XmlAttribute] public int RsvpCode { get; set; } public List<Guest> Guests { get; set; } public string Comments { get; set; } } public class Guest { [XmlAttribute] public string Name { get;...

Rendering a view on-the-fly

I'm developing an ASP.NET MVC application that will send the user a confirmation email. For the email itself, I'd like to create a view and then render that view and send it using the .NET mail objects. How can I do this using the MVC framework? ...

Unittest ActionFilter

There is an ActionFilter on my controller-class. The OnActionExecuting method gets called, when an action of the controller is called in a web application. Now I call the Action in a UnitTest: NiceController niceController = new NiceController(); ActionResult result = niceController.WhateverAction(); Is there a way to have th...

ASP.NET MVC AJAX Calendar

I am currently learning ASP.NET MVC and I have followed Stephen Walther's tutorial: ASP.NET MVC Tip #36 – Create a Popup Calendar Helper. The calendar is working, but I would like to change the date format to dd/mm/yyyy. Also are you able to add arrows at the top, so that the calendar can be changed by year as well as month? ...

Extending WebFormView in MVC

Howdy, I want to extend the WebFormViewEngine so that I can perform some post-processing - I want it to do it's stuff, then hand me the Html back, so I can do put some final touches to it. It needs to be done as a View/ViewEngine because I need access to the ViewData. Unfortunately there seems to be no way to get the Html back from th...

When encoding HTML input for security, how do I avoid encoding international characters like Ñ or ñ?

I have a textarea in an ASP.NET MVC Application where the user can type some text. When I show the text to the user, I use Html.Encode to prevent malicious input. The problem is that the user can type in Spanish and maybe he types año and the Encode transforms this into a&#241o. How Can I prevent this? EDIT: In the generated HTML, I see...

Returning an MVC ActionResult before the specific controller method is called

I have a base controller class from which my other controllers are inherited public abstract class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { base.Initialize(requestContext); ... } } During initialization I'm doing some setup, and the...

What are biggest problems being had with ASP.Net MVC

What are the biggest problems that is being encountered with ASP.Net MVC and what have you done to work around them? So far my biggest problems are: Problem: Keeping up with the changes (RCx, beta, etc). Workarounds: Compiling till it works. Problem: Remembering and dealing with the Futures DLL. Workaround: Download the latest, c...