当前位置:网站首页>WebForm DropDownList bind year and month respectively
WebForm DropDownList bind year and month respectively
2022-08-02 08:07:00 【descendants of the sun】
WebForm DropDownListBinding years respectively
I started a new request today,Then you will meet different knowledge,Come and meet me

The graph is made of demanders,Requirements are from last year,So the small year is2021,followed by a month drop-down box,Both the default selected this year this month,Does such demand make you want to try it??来吧,展示
<form runat="server">
<div class="clearfix mt15">
<div class="fl sx-bt">时间:</div>
<div class="fl fw-ed">
<div class="fl">
<asp:DropDownList ID="ddlYear" runat="server" CssClass="textbox-3"></asp:DropDownList>
</div>
<asp:DropDownList ID="ddlMonth" runat="server" CssClass="textbox-3"></asp:DropDownList>
</div>
</div>
</div>
</form>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BandTime();
}
}
private void Bind()
{
BandTime();
}
private void BandTime() {
ddlYear.Items.Clear();
for (int i= System.DateTime.Now.Year; i>=2021;i--) {
ListItem li = new ListItem(i.ToString()+"年", i.ToString());
ddlYear.Items.Add(li);
}
ddlMonth.Items.Clear();
for (int i = 12; i >= 1; i--)
{
ListItem li = new ListItem(i.ToString() + "月", i.ToString());
ddlMonth.Items.Add(li);
}
ddlMonth.SelectedValue = System.DateTime.Now.Month.ToString();
}
got gastroenteritis,Had a two weeks and then I eat vegetarian food,Finally got better this week,Then start eating meat,The spirit is not good
结论:Eating meat really increases the burden on the stomach.Want to work more,Better to be vegetarian.
边栏推荐
- MySQL-底层设置
- LeetCode brush questions (7)
- Transimpedance amplifier
- MySQL - slow query log
- Modify apt-get source to domestic mirror source
- spark架构
- A full review of mainstream timed task solutions
- MySQL-数据库设计规范
- OC-NSNumber and NSValue are generally used for boxing and unboxing
- Mysql报错2003 解决办法 Can‘t connect to MySQL server on ‘localhost‘ (10061)
猜你喜欢
随机推荐
regular expression
flutter在导航栏处实现对两个列表的点击事件
A Preliminary Study on the Basic Principles of Formal Methods
Fatal error compiling: 无效的目标发行版: 11
mysql如何从某一行检索到最后
静态路由综合实验
Find the largest n files
flutter解决键盘和输入框不适配问题
About the SQL concat () function problem, how to splice
MGRE环境下的OSPF
Data reveal that the average cost is as high as $4.35 million in 2022, a record!
神经元网络
MySQL batch update
The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]
概率论与数理统计
替换ptmalloc,使用tcmalloc和jemalloc
59: Chapter 5: Develop admin management services: 12: MongoDB usage scenarios; (non-core data, non-core data with a relatively large amount of data, small private files such as face photos;)
postgres groupby 合并字符串
MySQL-数据库设计规范
MySQL-执行流程+缓存+存储引擎









