当前位置:网站首页>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.
边栏推荐
猜你喜欢
Fatal error compiling: 无效的目标发行版: 11
LeetCode 2360. 图中的最长环
playwright 爬虫使用
mysql操作入门(四)-----数据排序(升序、降序、多字段排序)
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;)
Probability Theory and Mathematical Statistics
MySQL-锁机制
初探形式化方法基本原理
机器学习笔记--数学库
HCIP 第十一天
随机推荐
MySQL-底层设置
【Network】IP, subnet mask
LeetCode刷题(7)
神经元网络
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
postgres groupby merge strings
sql创建表格 如图 运行完提示invalid table name 是什么原因
MySQL-FlinkCDC-Hudi enters the lake in real time
论文理解:“Cross-Scale Residual Network: A GeneralFramework for Image Super-Resolution,Denoising, and “
数据中心的网络安全操作规范
初探形式化方法基本原理
MySQL-数据库事务详解
apt & apt-get commands
MySQL-数据库设计规范
常用的云安全防护措施盘点
OC-NSNumber and NSValue are generally used for boxing and unboxing
ROS file system and related commands
Chain Of Responsibility
playwright 爬虫使用
MySQL batch update