当前位置:网站首页>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.
边栏推荐
- redis-高级篇
- typescript学习
- (2022 Niu Ke Duo School 5) D-Birds in the tree (tree DP)
- Chain Of Responsibility
- spark读取文件夹数据
- The best interests of buying and selling stocks with handling fees [What is missing in the definition of DP status?]
- Aided by training and learning by battle | The new version of the Offensive and Defense World Platform is officially launched!
- OC-NSNumber and NSValue are generally used for boxing and unboxing
- Metasploit(MSF)基础超级详细版
- MySQL error 1055 solution: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
猜你喜欢

MySQL-索引详解

Aided by training and learning by battle | The new version of the Offensive and Defense World Platform is officially launched!

MySQL - slow query log

HCIP 第六天

MySQL - low level settings

用户身份标识与账号体系实践

MySQL常见索引类型

初探形式化方法基本原理

Visual Analysis of DeadLock

(2022 Nioke Duo School 5) C-Bit Transmission (Thinking)
随机推荐
MySQL - based
[mixed] PIP in domestic source tutorial and domestic source address
Metasploit (MSF) Basic Super Detailed Edition
postgres 水平分表,自动创建分区,按时间分表
静态路由综合实验
Azure Synapse Analytics上创建用户并赋予权限
Find the largest n files
读入、输出优化
神经元网络
Buried development process
postgres groupby merge strings
Aided by training and learning by battle | The new version of the Offensive and Defense World Platform is officially launched!
理论问题与工程问题的差异在哪里?
Introduction to Totem Pole and Push-Pull Circuits
Please tell me, how to write Flink SQL and JDBC sink into mysql library and want to create an auto-incrementing primary key
flutter 自己写一个组件
Appium 滑动问题
2022年防止网络攻击的15个网络安全实践,你学会了吗?
MySQL - locking mechanism
Splunk Field Caculated Calculated Field