Skip to content

uunlu/HtmlExtensionsSamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Html Extensions Samples

Asp.NET MVC Html Extensions Samples

Why To Use Html Extensions?

    Using modular and re-useable code always takes a lot of overhead over shoulders. By extending existing MVC Helper classes following benefits can be achieved:
  • Simplify Html code and keep view cleaner.
  • Combine several lines of Html in a single Helper
  • Create clean code on view

In this sample, Asp.NET project, there are some Html Extension helper classes and methods created.

---------------------------

-> Go to Components Folder

You can see Html Helper method samples under "Components" folder.

-> HtmlExtensionsImage:

Usage Example:
Helper.Image("imagelink", "alt", new { class ="img-responsive" } )

There are different overload methods available.

-> HtmlExtensionsButton:

Custom bootstrap button helper extensions.

-> HtmlExtensionsTextBox:

Custom bootstrap textbox and form field helper extensions.

Usage Example:
@Html.FormFieldTextBoxFor(x => x.Team, HtmlExtensions.HmlExtensionsCommon.InputTypes.text, new { @class = "form-control" })

FormFieldTextBoxFor adds TextBox with Label in Bootstrap style. Label value is read from expression property name or Custom Data Attribute if exists.

-> HtmlExtensionsCheckBox:

Custom bootstrap style checkbox extensions.

-> HtmlExtensionsImageBox:

Bootstrap customizable image box.

Usage Example:
@Html.ImageBoxFor(x => x.Image, "", "logo-barca", true, HmlExtensionsCommon.ImageTypes.roundedCorners, new { @title="Barcelona City"})

About

Asp.NET MVC Html Extensions Samples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published