.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

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -