Commit Graph

24 Commits

Author SHA1 Message Date
Ryan Nowak 84d2e027f5 Use new Razor in MVC 2017-01-30 10:55:49 -08:00
Kiran Challa 82b2e9c75c Added functional tests for Antiforgery related to setting no-cache headers 2016-11-02 16:29:34 -07:00
Doug Bunting 62803d5979 Serialize JSON using camel case by default
- #4283
- update `JsonSerializerSettingsProvider` to choose the `CamelCaseNamingStrategy`
2016-06-09 11:58:23 -07:00
Ryan Nowak 2e2784aa3d [Design] Split up MvcRouteHandler
This change splits up the conventional routing path from the attribute
routing path *inside* routing, instead of inside `MvcRouteHandler`. Each
attribute route group now gets its own instance of
`MvcAttributeRouteHandler` which just knows about the actions it can
reach.

This removes the concept of a route-group-token and removes the lookup
table entirely for attribute routing. This also means that the
`DefaultHandler` on `IRouteBuilder` will not be used for attribute routes,
which we are OK with for 1.0.0.

The action selector's functionality is now split into two methods. We
think this is OK for 1.0.0 because any customization of `IActionSelector`
up to now had to implement virtually the same policy as ours in order to
work with attribute routing. It should now be possible to customize the
selector in a meaningful way without interfering with attribute routing.
2016-06-07 08:12:47 -07:00
Kiran Challa 93be3dee6e Fix FormTagHelper to set flag indicating generation of AntiforgeryToken
[Fixes #4595] Better error message with extraneous @Html.AntiforgeryToken
2016-05-20 04:29:01 -07:00
Doug Bunting e3db547011 Add `[Remote(routeName : "name")]` tests
- relates to #4445
- also relates to #4309 / fb07fee though restored and renamed files are slightly different
 - latest Unobtrusive version; copy just one file under `wwwroot`
- add JavaScript file and CDN links to enable manual testing of `[Remote]` tests in `BasicWebSite`
 - include renamed files for recreating the minimized JavaScript file manually
2016-05-03 12:25:00 -07:00
Doug Bunting d8d2e54506 Remove extra options to manipulate `JsonSerializerSettings`
- #4339: remove non-recommended JSON formatter constructors
 - affects `JsonInputFormatter`, `JsonOutputFormatter`, `JsonPatchInputFormatter`
 - `JsonOutputFormatter` cleanup also impacts `JsonHelper`
 - rename and make `SerializerSettingsProvider` class public; use it as appropriate
- #4409: make `SerializerSetings` properties get-only and `protected`
 - affects `JsonInputFormatter`, `JsonOutputFormatter`

Recommended patterns:
- change `JsonSerializerSettings` values in `MvcJsonOptions` for almost all customizations
- find `JsonOutputFormatter` in `MvcOptions.OutputFormatters` when limiting per-result formatters
- start with `JsonSerializerSettingsProvider.CreateSerializerSettings()` when customizing a per-result formatter
2016-04-27 14:48:16 -07:00
ryanbrandenburg f1fa1bd8f4 * Remove JsonViewComponentResult 2016-03-11 11:40:54 -08:00
N. Taylor Mullen 096007b394 Updated `Controller`s `ViewComponent` method to handle arguments.
- This bit was missed when changing the `ViewComponent` invocation pattern resulting in the inability to invoke `ViewComponent`s with arguments in a `Controller`.

#4004
2016-02-02 15:42:23 -08:00
Ajay Bhargav Baaskaran f0777b95a8 [Fixes #3868] Exclude Antiforgery token in form with method Get 2016-01-21 11:29:41 -08:00
Ryan Nowak 676bde29b9 Make Begin[Route]Form include antiforgery 2016-01-07 13:24:01 -08:00
Pranav K 399e516065 Modify IViewComponentHelper to remove method selection ambiguity.
Fixes #612
2015-12-23 10:02:51 -08:00
Doug Bunting 59824dc7be MVC functional test cleanup (part 1)
- #3612 subpart 2 of 2
- merge `ActionConstraintsWebSite`, `AntiforgeryTokenWebSite` and `ContentNegotiationWebSite` into `BasicWebSite`
  - remove tests depending on `ErrorReporterMiddleware` in merged sites; not used in `BasicWebSite`
- delete `CompositeViewEngineWebSite`, `Microsoft.AspNet.Mvc.ViewEngines.CompositeViewEngineTest` covers cases
- delete `CorsMiddlewareWebsite`, soon to be in Cors repo (see aspnet/CORS#57)
- remove `SendFileMiddleware` from FilesWebSite, unused there
2015-12-14 21:50:55 -08:00
Kiran Challa 57b88baad0 [Fixes #3624] MVC functional test cleanup (part 2) 2015-12-10 16:26:39 -08:00
Kiran Challa 9288ab1a34 Removed TempDataWebsite and merged to BasicWebsite and fixed tests 2015-12-03 14:42:11 -08:00
Kiran Challa 3c694ce77c Movig RequestServicesWebsite to BasicWebsite 2015-12-03 14:42:10 -08:00
Ajay Bhargav Baaskaran 48e0b3261c [Fixes #2547] Fixed attribute value prefix with dynamic content being ignored 2015-05-18 17:15:38 -07:00
James Newton-King ab4cd5c4c4 Add JsonHelper for serializing JSON in views
- remove NotNull from JsonHelper Serialize
2015-05-11 16:01:08 -07:00
Doug Bunting 5e067cdb9e Delete trailing whitespace
- #EngineeringDay
- Total replaced: 660  Matching files: 270 in *.cs
- Total replaced: 250  Matching files: 32 in all other files
- Total replaced: 22  Matching files: 8 in a few stragglers

Did not change files under following directories
- test\Microsoft.AspNet.Mvc.Razor.Host.Test\TestFiles\Output
- test\Microsoft.AspNet.Mvc.FunctionalTests\compiler\resources
- test\WebSites\TagHelpersWebSite
(Razor generates trailing whitespace in a case or two)
2014-11-20 16:18:09 -08:00
Kiran Challa e985c22528 [Fixes #1216] Provide a property on JsonOutputFormatter to set serializer settings
[Fixes #1221] Rename OutputFormatter's WriteResponseContentHeaders to WriteResponseHeaders
[Fixes #932] Setting Json Serializer Settings
2014-10-15 09:27:09 -07:00
jacalvar 1680616fe5 [Issue #1133] RedirectToActionResult and UrlHelper should use HostString, PathString, etc. To build Urls.
Added tests to describe the current behaviour with Unicode hosts.
2014-10-14 16:12:29 -07:00
Kiran Challa fdeff1188b [Fixes #926] Protocol & Host name ignored when creating action link 2014-09-26 17:20:56 -07:00
Javier Calvarro Nelson 16f19b5cc6 Added functional tests to cover rendering views without layout and
to return a result without content.
2014-06-09 13:35:31 -07:00
Javier Calvarro Nelson 931a3cd809 Added functional tests for MVC.
Created a test project to hold functional tests, a basic
application for test purposes under test\WebSites and added
the first functional test to validate view rendering.
2014-05-28 12:46:41 -07:00