Search

You searched for the word(s): userid:751518

Matching Posts

  • Re: HandleErrorAttribute / HttpContext.IsCustomErrorEnabled - Reasons for Change?

    [quote user="levib"] If an exception is thrown and we redirect to an error view, we lose that information, which defeats the purpose of using ModelState (and hence binders) in the first place. [/quote] But if an exception IS thrown an ugly error message will be shown instead of the one that I've specified? I realize you're trying to get users to use the ModelState, but perhaps there's a better way to accomplish this. Sorry to be argumentative. In my case all of my "views"
    Posted to ASP.NET MVC (Forum) by Woil on 9/9/2008
  • Re: HandleErrorAttribute / HttpContext.IsCustomErrorEnabled - Reasons for Change?

    Just to clarify, I should put all of binding errors into the ModelStateDictionary and then handle them individually in my controller actions? public ActionResult ViewProduct(Product p) { if (!ViewData.ModelState.IsValid) //redirect to error display view ... That seems a bit excessive if I instead I could actually handle the exception thrown via the Exception view. Why not both? If a bind error is thrown why not catch it with the custom errors?
    Posted to ASP.NET MVC (Forum) by Woil on 9/9/2008
  • Re: HandleErrorAttribute / HttpContext.IsCustomErrorEnabled - Reasons for Change?

    Also worthy of discussion: Parameter Binding errors are not caught by the ExceptionFilters. If a parameter does not bind correctly there is no way to catch the error with the HandleError attribute on a action or controller. A review of ControllerActionInvoker shows the code as: public virtual bool InvokeAction(ControllerContext controllerContext, string actionName) { ... IDictionary < string , object > parameters = GetParameterValues(methodInfo); FilterInfo filterInfo = GetFiltersForActionMethod
    Posted to ASP.NET MVC (Forum) by Woil on 9/9/2008
  • Re: HandleErrorAttribute / HttpContext.IsCustomErrorEnabled - Reasons for Change?

    From the HandleErrorAttribute.cs in the Mvc Preview 5, note the comment: // If custom errors are disabled, we need to let the normal ASP.NET exception handler // execute so that the user can see useful debugging information. if (filterContext.ExceptionHandled || !filterContext.HttpContext.IsCustomErrorEnabled) { return ; } I want the custom errors disabled for most exceptions. I want to see that juicy stack trace goodness. Eventually when I deploy I'll turn them off of course. But before and
    Posted to ASP.NET MVC (Forum) by Woil on 9/9/2008
  • Re: How to cancel Action execution in Preview 5

    You can also use the IAuthorizationFilter interface to get access to the cancel property. public class SecurityActionFilterAttribute : FilterAttribute , IAuthorizationFilter { public virtual void OnAuthorization( AuthorizationContext filterContext) { filterContext.Cancel = true; //or whatever } }
    Posted to ASP.NET MVC (Forum) by Woil on 9/9/2008
  • HandleErrorAttribute / HttpContext.IsCustomErrorEnabled - Reasons for Change?

    I skimmed over it in the release notes, but noticed it when my rescues weren't working anymore. If (HttpContext.IsCustomErrorEnabled) then all [HandleError] attributes are ignored in version 5. For some errors this might be the ideal solution, but for others it isn't. In my case, I throw exceptions when a user doesn't fill out a form correctly. (For example putting letters in a phone number box.) These exceptions are then handled by the view and displayed nicely to the user. (All with
    Posted to ASP.NET MVC (Forum) by Woil on 9/8/2008
  • Re: Json date serialization

    I find it best to use James Newton King's Json.Net library. It allows for multiple ways to parse the date, including easy ways to specify your own way to parse anything with the JsonConverter class. http://james.newtonking.com/pages/json-net.aspx
    Posted to ASP.NET MVC (Forum) by Woil on 8/22/2008
    Filed under: json
  • Re: mvc toolkit img extensions

    Would sure be nice if there were a central place to report bugs, upload patches etc.
    Posted to ASP.NET MVC (Forum) by Woil on 1/25/2008
  • Re: The model namespace is already in use...

    [quote user="marcind"] Just to verify, area you talking about a Linq to SQL or Entity Framework model? [/quote] This would be a new Entity Framework model using the latest 3.5 extensions preview and ADO.NET Entity Designer preview. If there's a better place to post this, let me know.
    Posted to ASP.NET 3.5 Extensions Preview (Forum) by Woil on 12/12/2007
  • The model namespace is already in use...

    In experimenting with this release I had created a data model from an imported database that was corrupted. Prior to it being corrupted I'd created a partial class in the same namespace to add functionality to the data model. After deleting out the references to the data model in the web.config and deleting the model itself I added a new one via the wizard. When I was asked what the Model Namespace I wanted, I noticed it had a 1 after it. On changing to the namespace I want I get the useful,
    Posted to ASP.NET 3.5 Extensions Preview (Forum) by Woil on 12/12/2007
Page 1 of 2 (18 items) 1 2 Next >