欢迎您访问我爱IT技术网,今天小编为你分享的编程技术是:【asp.net中日历函数Calendar的使用方法】,下面是详细的讲解!
asp.net中日历函数Calendar的使用方法
今天介绍的是微软提供的ajax calendar控件。这个控件使用了ajax的效果,并通过前台js和style设置事件和效果。功能丰富、样式自有,实为网站设计、mis开发之必备控件。按照惯例,现在该贴代码了:
<asp教程:textbox runat="server" id="txtcalendar" width="150" />
<ajaxtoolkit:calendarextender runat="server" targetcontrolid="txtcalendar" css教程class="mycalendar" format="yyyy-mm-dd" />
由于设置了样式,所以这里也把代码贴出来吧,只是写一个简单的样式:
这样运行的时候,你会发现,丫的居然是英语的,没有咱们汉语,这让我们情何以堪呀!怎么办呢?当然有解决办法,并且很轻松的实现。不卖关子了,其实只需要设置enablescriptglobalization 和 enablescriptlocalization 为true就可以了。
接下来的说说属性吧,targetcontrolid不说了,format就是设置显示的样式,和c#中日期格式format是一样的。popupbuttonid是点击的弹出的按钮控件id。
样式有很多:
.ajax__calendar_container
.ajax__calendar_header
.ajax__calendar_prev
.ajax__calendar_title
web 控件标准属性
accesskey, attributes, backcolor, bordercolor, borderstyle, borderwidth,
cssclass, enabled, font, enabletheming, forecolor, height, isenabled,
skinid, style, tabindex, tooltip, width如需完整描述,请访问 web 控件标准属性。
控件标www.3ppt.com准属性
apprelativetemplatesourcedirectory, bindingcontainer, clientid, controls,
enabletheming, enableviewstate, id, namingcontainer, page, parent, site,
templatecontrol, templatesourcedirectory, uniqueid, visible如需完整描述,请访问控件标准属性。
关于asp.net中日历函数Calendar的使用方法的用户互动如下:
相关问题:asp.net日历(不要使用控件)
答:如果只是第一种,这个能帮助你 ----------ASPX------------ ------------CS----------------- /// /// 日历呈现日时激发 /// /// /// protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { string userId = User.Identit... >>详细
相关问题:js中日历控件calendar.js怎么设置只显示年份?
答:其实,其实只是要一个默认值是吧! 我觉得有两种实现方法 第一种就是通过动态语言赋值,比如asp.net 第二种就是通过js,赋值 比如有一个 写一个函数 function showtime(){ var t = document.getElementById("time"); var date = new Date(); t.v... >>详细
相关问题:请问在C#中,怎么实现用label显示calendar中选择的日期
答:你可以把代码发过来大家看一看。 如果是asp.net的话,你看看有没有加ispostback date.Text=calendar1.SelectedDate.ToShortDateString();这句不应该写在页面加载函数里, 要写在日历控件的Calendar1_SelectionChanged事件中。 就OK啦。 >>详细
- 【asp】asp.net url重写浅谈-net-url重写
- 【DataSet】DataSet、DataTable、DataRow区别详解
- 【asp】asp.net 动态添加多个用户控件-net-动态添
- 【ASP】ASP.NET中内嵌页面代码的一个问题-NET-内
- 【As】Asp.net中的页面乱码的问题-sp--pn-ne-et
- 【增加记录】asp.net中获取新增加记录的ID Access
- 【创建】ASP.NET Web API教程 创建域模型的方法详
- 【Asp】Asp.net 页面调用javascript变量的值-net-
- 【ASP】ASP.NET 5升级后如何删除旧版本的DNX-NET5
- 【404页面】ASP.NET设置404页面返回302HTTP状态码
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
