开发者

increase and decrease date

开发者 https://www.devze.com 2022-12-11 10:13 出处:网络
I want to increase and decrease date on image button click.e.g. < 10/11/09 >. how can i do t开发者_高级运维hat???The easiest way to code is with two regular buttons and (server side) code behind.

I want to increase and decrease date on image button click.e.g. < 10/11/09 >. how can i do t开发者_高级运维hat???


The easiest way to code is with two regular buttons and (server side) code behind. Read the date from the input field, AddDays(1) or AddDays(-1) and rewrite that input field.

A more user-friendly way would use client-side javascript.

See also for example the Ajax Toolkit Library that adds a (client side) calendar selector to a TextBox. See http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx .


In the button click event get the date, create a new instance with the AddDays, AddMonths method etc., then set the text back as necessary.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号