How to use HTML-5 data-* attributes in ASP.NET MVC
2013-04-24 00:48
791 查看
// 1: pass dictionary instead of anonymous object <%= Html.ActionLink( "back", "Search", new { keyword = Model.Keyword, page = Model.currPage - 1}, new Dictionary<string,Object> { {"class","prev"}, {"data-details","yada"} } )%> // 2: pass custom type decorated with descriptor attributes public class CustomArgs { public C e13b ustomArgs( string className, string dataDetails ) { ... } [DisplayName("class")] public string Class { get; set; } [DisplayName("data-details")] public string DataDetails { get; set; } } <%= Html.ActionLink( "back", "Search", new { keyword = Model.Keyword, page = Model.currPage - 1}, new CustomArgs( "prev", "yada" ) )%>
转自:How to use HTML-5 data-* attributes in ASP.NET MVC
相关文章推荐
- ASP.NET MVC Toolkit - how to use the Html Helper class
- How to create custom html helper in Asp.net MVC 3 or 4
- ASP.NET MVC: how to include <span> in link from Html.ActionLink?
- How to use jquery or ajax to update razor partial view in c#/asp.net for a MVC project
- How to use AspnetUpload™ in your web application
- How to use Asp.Net Mvc ActionFilterAttribute for form authentication
- How to use Console.WriteLine in ASP.Net (C#) during debug?
- How to create UrlSlug in Asp.Net MVC
- How to achive the CRUD in ASP.NET MVC(VS2010)
- How to use Session attributes in Spring-mvc
- How to use ValidationSummary control in asp.net
- asp.net3.5 csharp: How to show HTML content in calendar tooltip?
- (转)How to use the ASP.NET MVC ModelBinder
- How to use Bundle&Minifier and bundleconfig.json in ASP.NET Core
- How To Use a DataReader Against an Oracle Stored Procedure in Visual C# .NET
- Three steps to use jQuery UI in ASP.NET MVC 5
- How to use Console.WriteLine in ASP.Net (C#) during debug?
- how to use javascript to control the usercotrol in the asp.net
- how to use Form Authentication in ASP.NET.
- [转]How to use an Area in ASP.NET Core