Creating HTML Helpers for Razor

Posted on 2011-10-24
Last Modified: 2012-05-12
I expect to code 15-20 HTML Helpers which are needed to keep my Razor files simple and to keep the HTML out of the Model.

We will be using XML as the data source and need to add the resulting values into list boxes, drop down losts, labels, etc. on the cshtml files.

Can you explain best practices for this and provide some sample code?

Question by:newbieweb
    LVL 4

    Accepted Solution

    You would want to use a XmlDataSource and just DataBind specific column to the differnt controls.

    Author Closing Comment


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now