62,046
社区成员
发帖
与我相关
我的任务
分享
public string FormatSortDateTime(string strTime)
{
DateTime time = DateTime.Parse(strTime);
return time.ToShortDateString();
}
public static void Add(string value, Func<string, string> format)
{
string formatValue = format(value);
//持久化
//...
}
public static List<string> GetList(string id)
{
return null;
}
//js的话就使用ajax调用add方法,再重新获取数据
//以下是页面按钮提交模拟
public void btnButton1_click()
{
var page = (IGetable)this.Page;
string value = page.TextBoxValue;
DataDictionaryManager.Add(value, s => s.ToLower());
//已定义的格式
DataDictionaryManager.Add(value, FormatSortDateTime);
this.DataBind();
}
function AddItem(value)
{
document.getElementById("DropDownList").options.add(new Option(value, ""));
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Insus.NET;
public partial class _Default : System.Web.UI.Page,IGetable
{
protected void Page_Load(object sender, EventArgs e)
{
}
//Insus.NET:实现接口
public string TextBoxValue
{
get {
return this.TextBox1.Text;
}
}
}