.net - MVC 5 HTML custom helper with content -


Is it possible to write a custom HTML helper, which contains some content, its body similar to BeginForm?

I want to write a helper which only shows a section when the user has a special role like this:

  @ html.DisplayForRoles ("Users, Manager ") {& lt; Div & gt; You can either admin or manager & lt; / Div & gt; & Lt; Div & gt; Other accessories & lt; / Div & gt; }  

Yes, yes it is.

What you want to do to create an HTML helper extension, there are several good guides, which I will not reproduce here, such as

or


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -