public string Hello(string name="World") { //return "Hello" + HttpUtility.HtmlEncode(name); return "Hello" + Server.HtmlEncode(name); }
当name参数未被赋值时,则name被赋值为"World";
当name参数值不为空时,则name被参数赋值。
public string Hello(string name="World") { //return "Hello" + HttpUtility.HtmlEncode(name); return "Hello" + Server.HtmlEncode(name); }
当name参数未被赋值时,则name被赋值为"World";
当name参数值不为空时,则name被参数赋值。