Commit Graph

59 Commits

Author SHA1 Message Date
Pranav K 153165f9ad
Handle OPTIONS requests without a handler in Razor Pages (#8528)
* Handle OPTIONS requests without a handler in Razor Pages

Fixes #7438
2018-10-04 12:25:36 -07:00
Simon Cropp b156dee4f1 Fix some spelling (#8378) 2018-09-06 07:39:01 -07:00
Pranav K 8eea0ad44c Update tests to latest compat switch 2018-08-23 08:09:02 -07:00
hishamco dee479fda7
Add partial helper to Razor Page \ PageModel
Fixes #7885
2018-07-09 11:01:15 -07:00
Pranav K 335500ab0e Use ModelMetadata from actual types for validation
Fixes https://github.com/aspnet/Mvc/issues/7952
2018-07-02 11:23:16 -07:00
Kiran Challa 35f7d3f09c Added tests to verify that RazorPages and FuzzyMatching with Head requests work 2018-05-01 14:01:00 -07:00
Pranav K 5d5222cdd8 Introduce BindPropertiesAttribute
* Allow controller and Razor Page models to be annotated with BindPropertiesAttribute
* Disallow BindPropertyAttribute from being declared on types.
* Do not allow arbitrary binding attributes to be applied to Razor Page models.

Fixes #7686
2018-04-20 14:32:14 -07:00
Kiran Challa faca3da42f Ensure ViewData is set on PageResult after a handler method executes
[Fixes #7665] Initializing PageResult.Page as part of result execution breaks Identity UI
2018-04-18 11:44:04 -07:00
Kiran Challa d5e044f693 [Fixes #7373] Assigning to the context's Result property, when implementing IPageFilter, causes an exception 2018-04-13 15:11:44 -07:00
Pranav K 133dd964ab Introduce ViewDataAttribute
Allow properties on controllers, Razor Page and Razor Page models annotatted with [ViewDataAttribute]
to populate ViewDataDictionary

Fixes https://github.com/aspnet/Mvc/issues/6525
2018-03-30 14:19:52 -07:00
Kiran Challa 0c084fa28a [Fixes #7518] NullReferenceException thrown when Controller method uses Guid parameter default value 2018-03-27 05:22:20 -07:00
Ryan Nowak 14429721d9 Make handler selector more flexible
Some details of this pending discussion, but this is a new 2.1 change
and compatibility switch in the spirit of making pages handler selection
less error-prone.

In particular we don't want anyone to have to define HEAD to do the
trivial thing. This currently routes all 'safe' HTTP methods to the GET
handler and all other HTTP methods to the POST handler.

This is technically not the correct thing to do for OPTIONS and TRACE,
so we might still do something different.

The tests will change a little depending on exactly what we decide to
do, but this is the main idea of the change.
2018-03-23 14:22:48 -07:00
Javier Calvarro Nelson 908e7a863b Improvements to the MVC testing package
* Clean up unnecessary workarounds on the build project.
* Remove the need to specify the content root relative to the solution
  and use a solution based on an assembly level attribute on the test
  assembly created at build time.
* Remove non parameterless constructors.
* Add support for creating specialized factories from the base factory
  and keep track of "child" factories for disposal.
* Add support for creating clients that handle cookies and redirects
  automatically.
2018-03-19 12:19:45 -07:00
Pranav K 946b64143e Allow override routes on Pages
Fixes #6605
2018-01-12 15:57:13 -08:00
Ajay Bhargav Baaskaran b20e35e76a Set RelativePhysicalPath in FileProviderRazorProjectItem 2018-01-11 13:20:17 -08:00
Pranav K 0e21bab125 React to naming change in Razor 2018-01-03 12:38:16 -08:00
Jass Bagga 0bb3f18049
Add support for BadRequest in RazorPages (#7097)
Addresses #7095
2017-12-01 12:03:24 -08:00
Doug Bunting 6b2a702ff4 Handle line ending differences in a few tests
- #6205
- combine `TagHelpers_SupportsPathNavigation()` and `TagHelpers_SupportsRelativeNavigation()` into one

nit: remove a few unnecessary `.Trim()` calls
2017-11-30 21:18:42 -08:00
Pranav K 197ef139d6 Provide a way within the Page/PageModel to run code before any handler runs
Fixes #6606
2017-09-22 09:25:22 -07:00
Pranav K 037c1ec47d Make @inherit + Razor Pages + _ViewImports work
Fixes #6769
2017-09-14 12:34:00 -07:00
Pranav K de38922601 Allow BindPropertyAttribute to be applied on PageModel
Fixes #6653
2017-09-12 10:34:19 -07:00
Pranav K bac68ba3c2 Injecting IViewLocalizer into Razor Page causing IndexOutOfRangeException
Fixes #6694
2017-09-06 13:54:38 -07:00
Pranav K 900a5c7c4c Add support for ResponseCache in Razor Pages
Fixes #6437
2017-08-18 16:25:40 -07:00
Pranav K a5b55edb93 Fix filter order (#6577)
* Fix filter order
2017-07-21 10:50:34 -07:00
Ryan Nowak 579aca0121 Define semantics for pagemodels
Fixes #6210

Now a pagemodel requires a [PageModel] somewhere in it's hierarchy. We
don't do a guess at whether or not your model class is a PageModel.
2017-06-29 09:24:57 -07:00
Pranav K 8df3032540 Add support for specifying filters on page models.
Fixes #6334
2017-06-28 14:43:02 -07:00
Ryan Nowak 0ad9c7d4eb Making Pages Binding Consistent
This changeset reckonciles the binding work we did for pages with
controllers.

A quick summary:
- Moves [BindProperty] to the MVC namespace (#6401)
- Makes [FromRoute] and friends behave consistently (#6402)
- Makes [BindProperty] work with controllers (untracked)
2017-06-26 18:11:44 -07:00
Pranav K c89f0a1e43 Allow AddPageRoute to route to pages root. (#6412)
* Allow AddPageRoute to route to pages root.
Fixes #6338
2017-06-20 12:33:33 -07:00
Pranav K 597a0c9a11 Add support for friendly routes in pages
FIxes #6325
2017-05-26 14:29:00 -07:00
Ryan Nowak c1dd95be2a Add a test for #6294
This case was fixed by 2992f8e - this commit just adds a test to verify
the fix.
2017-05-24 16:53:30 -07:00
Ryan Brandenburg 42b988ad88 ./ paths relative on page. 2017-04-25 11:57:58 -07:00
N. Taylor Mullen 5c8a161ace Change `FormTagHelper` to apply to all form tags.
- Added functional test to validate that non-attributed form tags have an antiforgery input generated. Re-generated baseline to reflect changes.
- Added a unit test to validate that parameterless `FormTagHelper`s behave as expected.

#6006
2017-04-24 18:39:01 -07:00
Ryan Nowak 04fd762943 Rename form-action -> handler 2017-04-24 14:15:35 -07:00
Pranav K ca017eced2 Add page to AnchorTagHelper and FormTagHelper
Fixes #6088
2017-04-21 18:12:54 -07:00
Pranav K f568d3c2bc Support finding "sibling" pages when using RedirecToPage
Fixes #6083
2017-04-21 18:12:52 -07:00
Ryan Nowak 297196baa0 Design updates to handler methods and binding
Implements #6091, #6072, #6090, #5927
2017-04-21 17:29:25 -07:00
Ryan Brandenburg 908b4c8d62 FormAction from QueryString 2017-04-21 15:04:37 -07:00
Ryan Nowak 4bf518b09b Fix #6140 - Allow linking between controller and page
The issue here is that route values used for action selection are
'global'. That means that pages need to have a 'null' route value for
'action' and controllers need to have a 'null' route value for pages. This
is the same way that areas work.

The fix is to move the 'merge' of route values up to a level where pages
and controllers can work together. Since ADPs use the russian-doll
pattern, the fix is to run this 'merge' in the controller ADP, but after
all of the ADs have been created.
2017-04-19 16:48:38 -07:00
Pranav K 3474bdf776 RedirectToPage from a form-action handler includes the formaction
Fixes #6104
2017-04-12 09:27:08 -07:00
Ryan Brandenburg 59a3aade9b Fix [TempData] for PageModel's 2017-04-11 16:45:44 -07:00
Pranav K 1e7972bd8f Add convenience methods for redirecting from a Razor Page back to itself
Fuxes #5953
2017-04-07 10:03:42 -07:00
Ryan Nowak 4032de064e Removing _PageStart.cshtml
Pages now also use _ViewStart.cshtml

Also contains some naming/text cleanup that was missed in the previous
commit.
2017-04-06 08:14:37 -07:00
Pranav K 925ad75cdf Add convenience methods for redirecting to another Razor Page
Fixes #5956
2017-04-04 14:36:22 -07:00
Ryan Brandenburg e5ccac8bf6 Add functional tests for RazorPage routes 2017-04-04 11:14:52 -07:00
Hisham Bin Ateya fe3d45fad1 Adding AllowAnonymousToPage & AllowAnonymousToFolder
Fixes #5884
2017-03-31 20:17:31 -07:00
Pranav K b22326323a Add properties to Page and PageModel
Fixes #6008
2017-03-28 13:26:38 -07:00
Pranav K e7101f248a Support model binding to Razor Pages properties on page and PageModel classes
Fixes #5952
2017-03-24 07:45:19 -07:00
Ryan Brandenburg e6cb639cc0 Add handler functional test 2017-03-20 10:05:29 -07:00
Pranav K bee1a55cff Use RazorPagesOptions.RootDirectory when looking for page hierarchies.
Fixes #5915
2017-03-14 18:56:50 -07:00
Ryan Brandenburg 82d87df166 Fix warning as error 2017-03-14 12:44:57 -07:00