I have a old site that I want to use something like HTML helpers to generate special HTML(in this case complexed buttons). I know how this works in ASP.NET MVC but how can I do it in Webform(not Razor).
I have read suggestions on static methods like this :
public class Helpers
{
public static string Label1(string target, string text)
{
return String.Format("<label for= '{0}'>{1}</label>", target, text);
}
}
But how is this used in the Webform?
BestRegards
Put
Helpers.cs
in yourApp_Code
folder then you can call it like so from youraspx
file:At your solution. Add a special folder
ASP.net Folder
called code. Then paste yourHelpers.cs
file at it. Then you can access it.