当前位置:网站首页>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.
边栏推荐
- Comprehensive experiment of MPLS and BGP
- ROS文件系统以及相关命令
- Splunk Filed extraction field interception
- 典型的一次IO的两个阶段是什么?阻塞、非阻塞、同步、异步
- Control 'ContentPlaceHolder1_ddlDepartment' of type 'DropDownList' must be placed inside a form tag with runat=server.
- LeetCode 2360. 图中的最长环
- Appium 滑动问题
- LeetCode刷题(7)
- 用户身份标识与账号体系实践
- Xilinx Constraint Study Notes - Timing Constraints
猜你喜欢
Buried development process
MySQL-索引优化和查询优化
Understand the Chisel language. 30. Chisel advanced communication state machine (2) - FSMD: Take Popcount as an example
Compact格式下MySQL的数据如何存储到磁盘
pnpm + workspace + changesets 构建你的 monorepo 工程
UG NX二次开发(C#)-外部模式-导出dwg格式的文件
MySQL - index explanation
MySQL - Index Optimization and Query Optimization
Understand Chisel language. 31. Chisel advanced communication state machine (3) - Ready-Valid interface: definition, timing and implementation in Chisel
Inverter insulation detection detection function and software implementation
随机推荐
spark read folder data
Inverter insulation detection detection function and software implementation
通过建立新的SaaS业务来推动增长的六种方法
Hack The Box - File Transfers Module详细讲解中文教程
From cloud computing to function computing
OC-NSNumber and NSValue are generally used for boxing and unboxing
Introduction to Totem Pole and Push-Pull Circuits
CollectionUtil: a collection of functional style tool
Please tell me, how to write Flink SQL and JDBC sink into mysql library and want to create an auto-incrementing primary key
OC-error prompt
研发创新编码器霍尔板,引领企业高质量发展
Xilinx Constraint Study Notes - Timing Constraints
Comprehensive experiment of MPLS and BGP
Compact格式下MySQL的数据如何存储到磁盘
spark读取文件夹数据
Splunk Field Caculated Calculated Field
MySQL-Execution Process + Cache + Storage Engine
sql创建表格 如图 运行完提示invalid table name 是什么原因
MySQL error 1055 solution: [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains
HCIP第二天