Esempio n. 1
0
		public static void RegistScript(WebPage page, string script, string format = null)
		{
			if (!string.IsNullOrEmpty(format))
			{
				script = string.Format(format, script);
			}
			if (!string.IsNullOrEmpty(script))
			{
				page.clientScripts.Add(script);
			}
		}
Esempio n. 2
0
		public static void AddPageVariable(WebPage page, string name, string content)
		{
			if (content.EndsWith(";"))
			{
				content = content.Left(-1);
			}
			AddPageScript(page, string.Concat("page.", name, " = ", content));
		}