Asp.net mvc image gallery
page 4 of 6
by Mohammed Salah
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 30659/ 90

How to make Basic HtmlHelper Method

   The Goal of creating custom htmlhelper is to reduce the html content you write if you use the template many times as you can get data and format it in html form  , So Html Helper method acts as wrapper for data and html as it returns string of html .

    Creating HtmlHelper is simply using Extension Method , Like this

      public static class MyCustomHtmlHelper
    {
        public static string CustomHtmlHelper(this HtmlHelper html, 
string htmlContent)
        {
           return "<p>this my first html helper </p>";
        }
     }

View Entire Article

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-10-06 3:30:46 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search