public static string CreateInput(string type, string name, string value) { ElementBuilder inp = new ElementBuilder("input",true); inp.AddAttribute("type", type); inp.AddAttribute("name", name); inp.AddAttribute("value", value); return inp.ToString(); }
public static string CreateURL(string url, string title, string text) { ElementBuilder anchor=new ElementBuilder("a"); anchor.AddAttribute("url", url); anchor.AddAttribute("title", title); anchor.AddContent(text); return anchor.ToString(); }
public static string CreateImage(string imgSrc, string alt, string title){ ElementBuilder img = new ElementBuilder("img", true); img.AddAttribute("src", imgSrc); img.AddAttribute("alt", alt); img.AddAttribute("title", title); return img.ToString(); }
public static string CreateInput(string type, string name, string value) { ElementBuilder inp = new ElementBuilder("input", true); inp.AddAttribute("type", type); inp.AddAttribute("name", name); inp.AddAttribute("value", value); return(inp.ToString()); }
public static string CreateURL(string url, string title, string text) { ElementBuilder anchor = new ElementBuilder("a"); anchor.AddAttribute("url", url); anchor.AddAttribute("title", title); anchor.AddContent(text); return(anchor.ToString()); }
public static string CreateImage(string imgSrc, string alt, string title) { ElementBuilder img = new ElementBuilder("img", true); img.AddAttribute("src", imgSrc); img.AddAttribute("alt", alt); img.AddAttribute("title", title); return(img.ToString()); }
static void Main(string[] args) { ElementBuilder div = new ElementBuilder("div"); div.AddAttribute("id", "page"); div.AddAttribute("class", "big"); div.AddContent("<p>Hello</p>"); Console.WriteLine(div); Console.WriteLine(div * 2); string myImage = HTMLDispatcher.CreateImage("../img/mnoo_qk.jpg", "selfi", "me on the beech"); Console.WriteLine(myImage); string myLink = HTMLDispatcher.CreateURL("http://www.w3schools.com/html/", "this is my title", "Visit our HTML tutorial"); Console.WriteLine(myLink); string myInput = HTMLDispatcher.CreateInput("number", "quantity", "230"); Console.WriteLine(myInput); }