Commit Graph

604 Commits

Author SHA1 Message Date
harshgMSFT 1536daa107 Adding NonAction Attribute 2014-04-14 16:18:16 -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 0e7dff9ca7 Get CoreCLR test builds compiling again
- no Mock without .NET 4.5
- reverts part of "Reviving support for IValidatableObject in CoreCLR"
- that was commit 0f6df5405b.
2014-04-12 13:45:11 -07:00
Pranav K 0f6df5405b Reviving support for IValidatableObject in CoreCLR 2014-04-10 22:09:57 -07:00
dougbu 0d9c052e43 Restore ability to run some tests using CoreCLR
- revert part of "Made a few more changes since we have new tooling"
- was commit b1fd5cc689
2014-04-10 17:15:17 -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 d2453c5832 Bringing back Razor.Host as an assembly as a TEMPORARY WORKAROUND
The tooling team needs this as separate assembly. This will be removed
again soon.
2014-04-10 15:54:47 -07:00
Wei Wang 86d327366f Fix wrong order of arguments passed to ArgumentException ctor 2014-04-10 13:56:50 -07:00
dougbu d7110017fd Sample should be built in VS
- catches errors because some methods are used only from views or controllers
2014-04-10 11:52:58 -07:00
Ryan Nowak 408d4056b1 Rearrange ViewContext 2014-04-10 11:40:57 -07:00
Ryan Nowak cda73e95a8 Integrate dictionary helper with existing code paths 2014-04-10 11:21:35 -07:00
dougbu f0c6512b61 Catch up with previous `ActionNameAttribute` addition 2014-04-10 09:27:45 -07:00
harshgMSFT 53b76380eb Adding ActionName Attribute 2014-04-09 15:48:30 -07:00
dougbu 1da2d6d9dc Checkin VS auto-update to .kproj file 2014-04-09 14:31:33 -07:00
dougbu 82b071c80e Add CR-requested comment 2014-04-09 14:30:12 -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
David Fowler b1fd5cc689 Made a few more changes since we have new tooling
- Remove runtime interface declarations and use
  Microsoft.Net.Runtime.Interfaces package
- Made tests compile for net45 and made default
  intellisense view net45 for unit tests since Moq
  doesn't work
2014-04-09 12:24:16 -07:00
David Fowler a970fa04ab Updated to use the new tooling 2014-04-09 12:24:16 -07:00
Ryan Nowak 35bfa84274 CR feedback 2014-04-09 11:10:05 -07:00
Ryan Nowak 4e1511ed4d Adding ActionLink 2014-04-09 11:07:15 -07:00
Pranav K c8ede78582 Expanding ValueProviderResult to support more data types
* Reviving tests for ValueProviderResult
2014-04-09 09:33:29 -07:00
Pranav K ea3e958563 Adding unit tests for CompositeModelBinder 2014-04-08 18:48:01 -07:00
Ryan Nowak 527394c492 CR feedback 2014-04-08 16:05:51 -07:00
Ryan Nowak e740633c06 CR feedback 2014-04-08 16:05:49 -07:00
Ryan Nowak ab605ef935 Fix for #215 - nullref trying to generate link in a partial
The fix here is to do some cleanup we've been planning to do for a while,
rather than flowing IUrlHelper and IComponentHelper as part of the
ViewContext, they now are just grabbed from the service provider.

This simplifies the code for invoking a view, and gets us closer to the
desired API surface of ViewContext
2014-04-08 16:05:48 -07:00
Ryan Nowak 749789c486 CR feedback 2014-04-08 15:57:40 -07:00
Ryan Nowak 084c7f80e5 Further rearranging IView/IViewEngine/ViewContext et al 2014-04-08 15:57:39 -07:00
dougbu 4feb8f4f28 Remove reduncant `ArgumentNullOrEmpty` resource from Core project
- came from Rendering but Core already had `ArgumentCannotBeNullOrEmpty`
- moved wording from "argument must not be" to "value cannot be"

Also make similar resources consistent in this repo
- adjust Razor's `ArgumentCannotBeNullOrEmpty` resource to use same wording
  as Core, adding "The"
- update ModelBinding to also have `ArgumentCannotBeNullOrEmpty` and to use
  it consistently with Core and Razor
2014-04-08 12:03:50 -07:00
Sornakumar b25091f6c1 Merge branch 'WebFX156' into dev 2014-04-08 10:52:38 -07:00
sornaks 7c8dd45b8b WebFX 156 - Adding support for Redirect and RedirectPermanent 2014-04-08 10:49:56 -07:00
harshgMSFT 01527cd4df Adding HttpPost, HttpDelete, HttpPut, HttpPatch attributes 2014-04-07 22:31:48 -07:00
Ryan Nowak faa8251b70 Merging Mvc.Rendering and Mvc.Core 2014-04-07 17:32:49 -07:00
harshgMSFT 652e89b343 Adding HttpGetAttribute and AcceptVerbsAttribute.
HttpPost, HttpDelete, HttpPut and HttpPatch would be similar.
Also adding few tests.
2014-04-07 15:10:22 -07:00
Ryan Nowak df16982697 Adding and updating old propertyhelper code for dictionaries 2014-04-07 14:41:24 -07:00
Ryan Nowak ec4b3a29c0 Adding smart link generation
This feature will enforce a contract that link generation has to point to
a real action. Read the comments in code for more details and rationale.
2014-04-07 14:37:52 -07:00
Ryan Nowak 3548a46ca9 CR feedback 2014-04-07 12:49:32 -07:00
Ryan Nowak d2386d7ded CR Feedback 2014-04-07 12:49:30 -07:00
Ryan Nowak 37f4e2efaa Adding more overloads for IUrlHelper
(cherry picked from commit 4ebe6b5e386388914160b07c91142a9e7483134b)
2014-04-07 12:49:29 -07:00
Pranav K 931d18b851 Adding exceptions for RenderSection, DefineSection and RenderBody 2014-04-07 12:25:44 -07:00
dougbu 1cd15fbf60 Add form HTML helpers and `MVCForm`
- copy over from legacy MVC
- fixup namespaces, remove copyright notices, ...
- temporarily remove `RouteBeginForm() overloads
- move main components to `HtmlHelper` and declare in `IHtmlHelper<T>`
- change `UrlHelper` to avoid treating an existing dictionary as an object
- add `HtmlHelper.Createform()` factory
- use in MVC sample; move BeginForm / TextBox samples to a new row
2014-04-07 12:04:28 -07:00
Pranav K 94c028a5df Adding support for RazorView.IsSectionDefined 2014-04-06 17:18:37 -07:00
N. Taylor Mullen c0d06f1fbc Fixed combination of Display Templated Helpers.
Had to make adjustments to allow the project to build (things that were missed by git).  Also made some changes to ensure it builds in CoreCLR.
2014-04-06 16:14:10 -07:00
N. Taylor Mullen 671c7dd59e Addressed code review comments. 2014-04-06 16:01:41 -07:00
N. Taylor Mullen 5026788145 Add sample for DisplayForModel Html Helper.
Showcased a lot of the core pieces of DisplayFor in the sample.  Some pieces are still missing such as DataType handling.  The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types.
2014-04-06 16:01:33 -07:00
N. Taylor Mullen 1f47abd758 Implement DisplayForModel Html Helper.
Essentially add extension methods and call through to infrastructure.
2014-04-06 16:01:10 -07:00
N. Taylor Mullen 4f67dee048 Addressed code review comments 2014-04-06 15:59:51 -07:00
N. Taylor Mullen 94bae850c7 Add sample for DisplayFor Html Helper.
Showcased a lot of the core pieces of DisplayFor in the sample.  Some pieces are still missing such as DataType handling.  The infrastructure is there to handle it in the TemplateRenderer but the model metadata providers do not construct the metadata with the data types.
2014-04-06 15:59:42 -07:00
N. Taylor Mullen 52ce83db9e Implement DisplayFor Html Helper.
Essentially add extension methods and call through to infrastructure.
2014-04-06 15:59:32 -07:00
N. Taylor Mullen 2b3687282e Addressed code review comments. 2014-04-06 15:57:32 -07:00