Commit Graph

99 Commits

Author SHA1 Message Date
sornaks 52c2e41bbb Adding default values to MvcSample.Web's FiltersController. Otherwise accessing the Actions would return 404 by default. 2014-05-28 11:04:14 -07:00
David Fowler 7388dece9f Fixed project.json casing 2014-05-26 02:50:43 -07:00
Pranav K a53e378cf4 Updating kproj file to match tooling changes 2014-05-18 20:13:56 -07:00
Sebastien Ros 630bf3cc5e Fixing project file 2014-05-12 14:52:41 -07:00
Ryan Nowak b9dbb6fe57 Fixing action selection with complex types - MVC scenarios with more than one parameter are broken right now 2014-05-09 18:08:54 -07:00
harshgMSFT 00c30791ea Fixing LinkController in the sample 2014-05-09 16:09:51 -07:00
dougbu 0b327ba7b4 Use `BeginForm()` in MVC sample 2014-05-09 10:40:56 -07:00
David Fowler ade41533f1 Updated the Startup 2014-05-09 00:48:26 -07:00
Andrew Peters f13865dedc Updating copyright headers 2014-05-08 23:01:20 -07:00
Wei Wang 7b2feab670 Sort dependencies and remove duplicates in dependencies 2014-05-07 18:24:04 -07:00
lajones 235707ec8a Microsoft.ComponentModel.DataAnnotations is being renamed to Microsoft.DataAnnotations 2014-05-07 13:35:36 -07:00
Pranav K 076dedcca5 Reacting to package and namespace changes 2014-05-06 14:06:29 -07:00
harshgMSFT 9b79664e2f Fixing Build break due to namespace move. 2014-05-06 10:04:58 -07:00
Wei Wang 4210211c79 Update dependency namespace 2014-05-05 20:01:04 -07:00
Ryan Nowak abbaa11212 Incorporate name changes: HttpAbstractions 2014-05-05 17:14:08 -07:00
Ryan Nowak 4ece9969bf HttpAbstractions 2014-05-05 16:29:14 -07:00
Ryan Nowak 28fee3470f Controller base class now implements IActionFilter 2014-05-05 15:47:16 -07:00
dougbu 67b33868a3 Add `ListBox()` and `ListBoxFor()` helper methods
- copy from legacy MVC
- get `ListBox[For]()` methods in correct places and working
 - also usual stuff: `var`, `[NotNull]`, remove `IDictionary<,>` overloads
 - `ListBoxHelper()` -> `GenerateListBox`
 - already had all the bits needed in `GenerateSelect()`
- special-case `null` or empty `name` in GenerateSelect()
 - ensure `ArgumentException` has correct parameter name
 - lower-level problem affected `CheckBox()` as well
- use `ListBox()` and `ListBoxFor()` in MVC sample
 - use `ListBox()` in an editor template
2014-05-05 14:26:06 -07:00
Louis DeJardin bbcac43aaa Updating DataAnnotations version reference 2014-05-02 20:53:12 -07:00
Ryan Nowak 490b6d1434 IServiceContainer changes should have added this 2014-05-02 19:03:32 -07:00
N. Taylor Mullen 2ce4c56915 Fixed sample to not override User property.
#277
2014-05-02 15:24:45 -07:00
dougbu 31cdc09647 Move Microsoft.AspNet.RequestContainer dependency from MVC sample to MVC
- 🐛 fix; fixes #346
2014-05-02 14:29:19 -07:00
anpete 8208cd6b2f Update file headers 2014-05-01 17:42:33 -07:00
harshgMSFT 3765abdfca Adding Support for LinkGeneration for named Routes.
- Adding HtmlHelpers for route link generation.
- Controller Helpers
- UrlHelper and UrlHelperExtensions
2014-04-30 18:34:46 -07:00
harshgMSFT a1f3c72e08 Updating the sample after namedRoute changes 2014-04-30 16:10:09 -07:00
Ryan Nowak 20c8dece7b Adding IFilterFactory
This is a generalized factory/provider for filters - TypeFilterAttribute
and ServiceFilterAttribute are now implemented in terms of this interface.
2014-04-30 13:18:10 -07:00
sornaks 185ad31491 Adding an appropriate sample to use ValidationMessage and ValidationMessageFor. 2014-04-30 11:07:02 -07:00
sornaks d63d998e95 Introducing DisplayText, DisplayTextFor, Id, IdFor, IdForModel.
Fixing CachedDataAnnotationsModelMetadata to support NullDisplayText.
2014-04-30 10:23:25 -07:00
sornaks 112a5ddc50 Changes enabling TextArea, TextAreaFor.
Changing the interface to directly include Rows and Columns.
2014-04-30 09:42:07 -07:00
Ryan Nowak 2ad1cca549 Issue #312 - TypeFilterAttribute (with sample).
Implmentation for understanding and consuming ITypeFilter was already
there.
2014-04-29 14:18:39 -07:00
Yishai Galatzer bcd0974823 Make the controller available to filters + Sample
GitHub WebFX #300
2014-04-29 10:33:21 -07:00
dougbu f7704ba68f Implement `Editor*()` HTML helpers
- copy over legacy `Editor*()` extensions and default editor templates
- get working in the new world
 - usual `var`, `String` -> `string`, `internal` -> `public`, namespaces, ...
 - longest overloads into `IHtmlHelper[<TModel>]` and implementation classes
 - clean up `ViewContext.ViewData` -> `ViewData`, trailing whitespace, long lines
 - remove `MultilineTextTemplate()` since `TextArea()` doesn't exist yet
 - remove `ColorInputTemplate()` since `Color` type doesn't exist
 - use `html.Label()`, not `LabelExtensions.LabelHelper()`: equivalent helper
   is protected.  only downside is potential `ModelMetadata` re-discovery.
 - rename `HtmlInputTemplateHelper()` -> `GenerateTextBox()`
- copy over `Html5DateRenderingMode` and `html.Html5DateRenderingMode` property
 - and get them working in new world
- hook the default editor templates up
- use `Editor()`, `EditorFor()`, `EditorForModel()` in MVC sample
 - add an on-disk editor template to MVC sample
2014-04-28 14:53:07 -07:00
Yishai Galatzer a5afd3eb42 ActionResult implements IActionResult, and all our default implementations now use ActionResult
All controller methods return the specific ActionResult type
2014-04-25 15:57:02 -07:00
Pranav K f5ba63ea1e Fixing missing files in kproj
Fixing typo in sample filter
2014-04-25 14:48:14 -07:00
Sebastien Ros 0fe028a4dd Implementing Authorize attribute
#272
2014-04-24 16:21:43 -07:00
dougbu b8731621df Add default `Display*()` templates
- first get old code in correct spot
- then get default templates working in new world
 - usual things: `[NotNull]`, `var`, internal -> public
 - provide a `HtmlHelper.GenerateOption()` static method
 - pass an `ViewDataDictionary<object>` instance to `TemplateRenderer` constructor
 - run default templates synchronously with an IHtmlHelper<object>
 - copy over resources
 - add Microsoft.Data.Entity reference for EntityState type
- use default templates in MVC sample
 - remove most on-disk overrides of the default templates
2014-04-19 19:00:42 -07:00
David Fowler 05a2319d84 Moved BuilderExtensions to Microsoft.AspNet namespace 2014-04-18 00:51:27 -07:00
David Fowler 73b7509368 Updated to use new UseServices API 2014-04-17 21:13:43 -07:00
David Fowler fba1b400fe Removed comment 2014-04-17 20:00:06 -07:00
David Fowler 73e1386724 Added UseMvc extension method via IBuilder extensions. 2014-04-17 19:55:23 -07:00
Louis DeJardin f19fe0cbef Filters version 2.0
This is functionally much more similar to legacy MVC.

Rather than a pure single pipeline, filter execution takes place in more
stages.
2014-04-17 11:45:58 -07:00
David Fowler 93c9b3419e Made some changes to the MvcApplication class
- Renamed it to MvcRouteHandler
- Removed required IServiceProvider ctor param.
- The HttpContext flows the application services through to MVC. This does
 require a call to app.UseContainer in order for things to work but that should be fine.
 This will be the pattern we use for all frameworks going forward and we'll need to have some
 good error handling around this area when things aren't wired up properly.
2014-04-17 00:02:10 -07:00
David Fowler 4fc0b56dfa Added extension method to ServiceCollection to register default services 2014-04-16 23:59:36 -07:00
Ryan Nowak 40e7fcc9ba Turning on warnings as errors 2014-04-16 20:21:07 -07:00
harshgMSFT 72732868c6 Adding DisplayName, Label HtmlHelpers. 2014-04-16 11:41:47 -07:00
dougbu 246bb2e3dd Add `DropDownList()` and `DropDownListFor()` HTML helpers
- copy over legacy MVC's `SelectExtensions`, `SelectListItem` and `SelectListGroup`
 - plus expected `SelectList` and `MultiSelectList`
- fixup select HTML helpers to meet WebFx standards and work in new world
 - usual stuff: `[NotNull]`, `var`, `String` -> `string`, long lines, ...
 - remove `IDictionary<string, object> htmlAttributes` overloads
 - move longest extension method overloads into correct classes / interfaces
 - add `ViewDataEvaluator.Eval()` overload for an `object` container
 - rename lower-level helpers to make purposes more obvious
 - nit: move Raw() methods up from bottom of HtmlHelper.cs
- use `DropDownList[For]()` in MVC sample
2014-04-14 16:05:07 -07:00
dougbu 271c849923 Fix #231; add `ViewBag` to `ViewComponent`
- update MVC sample to demonstrate use and that `ViewBag` is scoped
- nit: add a bit of padding between border and tag cloud words
2014-04-12 14:10:16 -07:00
dougbu ba08f8e8d8 Cleanup Display, Partial, and Validation extensions
- correct file and class names for some HH extensions
 - three class names were correct but didn't match containing file
 - three class and file names matched but didn't start with HtmlHelper
- clean up trailing whitespace and long lines in changed Extensions.cs files
 - `HtmlHelperPartialAsyncExtensions`, `HtmlHelperRenderPartialAsyncExtensions`
   and `HtmlHelperValidationExtensions` lacked some `[NotNull]` attributes
- merge extension files by concept
 - Display / DisplayFor / DisplayForModel methods all into `HtmlHelperDisplayExtensions`
 - Partial / RenderPartial methods all into `HtmlHelperPartialExtensions`
- use `IHtmlHelper<TModel>` everywhere
2014-04-10 17:12:16 -07:00
Ryan Nowak 408d4056b1 Rearrange ViewContext 2014-04-10 11:40:57 -07:00
dougbu f0a97772f5 Add remaining HTML input helpers
- add `CheckBox[For]()`, `Hidden[For]()`, `Password[For]()`, and
  `RadioButton[For]()`
- also make `FormatValue()` visible to users, as it is in legacy MVC
- and spread the boxes out a bit in MyView 😺
2014-04-09 12:52:47 -07:00