我用JS来控制时间控件的显示和隐藏,,cs里: TextBox2.Attributes.Add("Onfocus", "javascript:show1();");
<asp:TextBox ID="TextBox2" runat="server" Onfocus="show1()" Style="left: 674px; position: relative;
top: -25px"></asp:TextBox>
<asp:Calendar ID="Calendar2" runat="server" Style="left: 676px; position: relative;
top: -16px;display:none; "></asp:Calendar>JS:
<script type="text/javascript">
function show1()
{
document.getElementById('Calendar2').style.display='';
}
</script>
但是当时间控件显示出来后,,我选择当前时间可以 一选其他月份 时间控件又不见了。。郁闷
if(!IsPostBack)
{
}
中,另外
function show1()
{
document.getElementById('Calendar2').style.display='';
}
display 与 none 对应的应该是 blockdocument.getElementById('Calendar2').style.display='block'; 还有,CSDN网友提供的一个日期控件我觉得还是比较实用的
My97日期控件My97DatePicker4
楼主可以查一下,
也比较简单
if(!IsPostBack)
{
}
中写。。其他人介绍的时间控件 ,,我初学者 还不清楚,,会的慢慢了解。谢谢
VS2003里常有这种问题,你可以把改变的ID放进document.getElementById('')中试一下
我用的是VS2005的 我刚按LS的看了,,没发生以上情况。