asp.net-mvc-futures

MVC3 ActionLink with images (but without MvcFutures)?

走远了吗. 提交于 2019-12-01 05:55:08
I was wondering if anyone knows if it possible to use any of the "out of the box" ASP.NET MVC3 helpers to generate a "link button"...I currently use following: <a class="button" title="My Action" href="@Url.Action("MyAction", "MyController", new { id = item.Id })"> <img alt="My Action" src="@Url.Content("~/Content/Images/MyLinkImage.png")" /> </a> I am trying to avoid using MvcFutures, but even if I was able to use them, I don't think there is a extension method it there that will accomplish this either. (I believe solution in this case would be to roll custom helper as seen here ) Finally,

MVC3 ActionLink with images (but without MvcFutures)?

半世苍凉 提交于 2019-12-01 03:11:39
问题 I was wondering if anyone knows if it possible to use any of the "out of the box" ASP.NET MVC3 helpers to generate a "link button"...I currently use following: <a class="button" title="My Action" href="@Url.Action("MyAction", "MyController", new { id = item.Id })"> <img alt="My Action" src="@Url.Content("~/Content/Images/MyLinkImage.png")" /> </a> I am trying to avoid using MvcFutures, but even if I was able to use them, I don't think there is a extension method it there that will accomplish

What is the syntax for a strongly-typed ActionLink in MVC 4 with MVC 4 Futures?

谁都会走 提交于 2019-11-29 03:42:08
I am using a new MVC 4 Internet application template with Visual Studio 2012. I have installed the Nuget package for MVC 4 Futures. In my _Layout.cshtml I am building the navigation menu. This works and builds the correct URL: @Html.ActionLink("Customers", "Index", "Customers") This is what I would like to work, a strongly-typed variation: @Html.ActionLink<CustomersController>(c => c.Index(), "Customers", null) It griefs on "Cannot choose method from method group. Did you mean to invoke a method?", but something tells me that's not the real issue. This compiles and outputs the right HTML, but

ASP.NET MVC RequireHttps

白昼怎懂夜的黑 提交于 2019-11-27 23:41:17
How do I use the ASP.NET MVC 2 Preview 2 Futures RequireHttps attribute? I want to prevent unsecured HTTP requests from being sent to an action method. I want to automatically redirect to HTTPS. MSDN: RequireHttpsAttribute RequireHttpsAttribute Members RequireHttpsAttribute.HandleNonHttpsRequest Method How do I use this feature? My guess: [RequireHttps] //apply to all actions in controller public class SomeController { //... or ... [RequireHttps] //apply to this action only public ActionResult SomeAction() { } } I think you're going to need to roll your own ActionFilterAttribute for that.

Cannot find Html.Serialize helper in MVC 5 futures

二次信任 提交于 2019-11-27 06:32:36
问题 I just installed MVC 5 futures in my solution using Package Manager, but I cannot find this helper method Html.Serialize , which was there in previous MVC Futures releases. My Question : What namespace I need to include to start using Html.Serialize helper method with MVC 5 Futures? 回答1: Apparently, this extension helper is no longer included in the current MVC Futures. In my case, I replaced the function call Html.Serialize by MvcSerializer.Serialize method which is included in Microsoft.Web

ASP.NET MVC RequireHttps

旧巷老猫 提交于 2019-11-26 21:33:30
问题 How do I use the ASP.NET MVC 2 Preview 2 Futures RequireHttps attribute? I want to prevent unsecured HTTP requests from being sent to an action method. I want to automatically redirect to HTTPS. MSDN: RequireHttpsAttribute RequireHttpsAttribute Members RequireHttpsAttribute.HandleNonHttpsRequest Method How do I use this feature? 回答1: My guess: [RequireHttps] //apply to all actions in controller public class SomeController { //... or ... [RequireHttps] //apply to this action only public