• Code
  • Tags
  • Users
  • Titles
  • Log in
  • Feedback
  • FAQ
Share Code
Welcome to ForkCan.com

ForkCan is all about sharing code in a social way.

Discuss, debate or argue with other devs about their or your own code.

Give other devs feedback or make a Fork (Make a better version of a shared code).

Rate the code, if you use the code mark it as used so others can see if the shared code is used by someone.

Help each other to be better devs and to be more productive.


Features not working yet:

Flag a post


QR Code

Tiny Url

http://4kcan.com/s/MjI0

Related Code
Google Analytics helper for ASP.NET Razor
Make sure the web.config pages/namespace can be used together with ASP.NET MVC 3 P1 and Razor
ForEach Extension method for IEnumerable<T>
Invoke Extension Method
Using DynamicObject to get a value from the Request.Params
Use of Extension methods to hide "infrastructure code"
PagedList class and paging code for ASP.Net MVC (Nothing new but kind of usefull.)
Unity Service Locator for ASP.NET MVC 3.0 Beta 1
Fork of GZIP your Actions in MVC if not used as standard in IIS7 or only use IIS6
Unity Controller Factory for ASP.NET MVC 3.0
UnitOfWork Action filter for ASP.NET MVC and nHibernate
IEnumerable<T> Exist extension method
ASP.NET MVC 4.0 Web API Message logger for .Net 4.0
GZIP your Actions in MVC if not used as standard in IIS7 or only use IIS6
Extension to the HttpClient
Parsing string to enum, extension method

StringFormat Extension method for HtmlHelper ASP.NET MVC

An extension method that format an string and return a IHtmlString

0
1.38k 0 0 0 0 0

public static class HtmlExtension
{
    public static IHtmlString StringFormat<T>(this HtmlHelper<T> helper, string format, params object[] values)
    {
        return new HtmlString(string.Format(format, values));
    }
}

Can be used like this:

<h1>@Html.StringFormat("View Invoice ({0}), Model.InvoiceNo )</h1>

Share: twitter | facebook   Action: used | fork | flag

aspmvc

Mark 'aspmvc' tag as 'like'

Mark 'aspmvc' tag as 'ignore'

c#

Mark 'c#' tag as 'like'

Mark 'c#' tag as 'ignore'

extension-method

Mark 'extension-method' tag as 'like'

Mark 'extension-method' tag as 'ignore'

razor

Mark 'razor' tag as 'like'

Mark 'razor' tag as 'ignore'


 @fredrikn "I'm the master"
3.11k
August 02, 2010 10:34 AM

Fork

 StringFormat Extension method for HtmlHelper ASP.NET MVC -  @fredrikn Monday 02, 2010 10:34 AM


0 Feedback


You must log in before you can give any feedback


0 Discussion(s)

Newest Oldest

You must log in before you can post a comment

Squeed
Made by: Fredrik Normén 2010