62,046
社区成员
发帖
与我相关
我的任务
分享
protected string[] Get客户列表(string input)
{
string key=string.Format("查询{0}省的客户列表",input);
object res=this.Cache[key];
if(res==null)
{
res=向数据库查询某省的客户列表(input);
this.cache.Insert(key,res,null,
System.Web.Caching.Cache.NoAbsoluteExpiration,new TimeSpan(0,0,5));
}
return (string[])res;
}
protected void myList_Selected(object sender, EventArgs args)
{
DropDownList dr = sender as DropDownList;
Label nameLabel = dr.FindControl("Name") as Label;
处理供货商x向客户y供货关系(nameLabel.Text,dr.SelectedValue);
}
<ItemTemplate>
<asp:DropDownList runat="server" ID="myList" DataSource='<%# this.Get客户列表((string)Eval("省份")) %>'
SelectedValue='<%# Eval("客户") %>' OnSelectedIndexChanged="myList_Selected" />
</ItemTemplate>
protected string[] Get客户列表(string input)
{
string key=string.Format("查询{0}省的客户列表",input);
object res=this.Cache[key];
if(res==null)
{
res=向数据库查询某省的客户列表(input);
this.cache.Insert(key,res,null,
System.Web.Caching.Cache.NoAbsoluteExpiration,new TimeSpan(0,0,5));
}
return (string[])res;
ret[i] = input + "_" + i.ToString();
return ret;
}