我正在使用Any + Time DatePicker / TimePicker允许我的用户在vb.net中选择日期和时间。但是我无法在后面的代码中检索值。有人可以指出正确的方向吗?
我正在像这样使用插件:
**aspx head:**
<script>
var curDateTime = new Date();
</script>
**aspx body:**
<input type="text" id="calDwnBgn"/>
<script>AnyTime.picker('calDwnBgn', { askSecond: false, earliest: new Date(curDateTime.getFullYear(), curDateTime.getMonth(), curDateTime.getDate(), curDateTime.getHours(), curDateTime.getMinutes(), 0), format: "%m/%e/%Z %k:%i:00" });</script>
我正在尝试像这样访问后面代码中的值:
Dim txtStrt As TextBox = TryCast(fv1.FindControl("calDwnBgn"), TextBox)
谢谢,比利
我以为我必须在窗体中找到控件,然后使用TextBox属性来获取值,但是通过向输入标签中添加name属性并调用Page.Request,我能够在代码中获取值。后面的代码形式:
<input type="text" id="calDwnBgn" name="_calDwnBgn"/>
然后在后面的代码中:
Page.Request.Form("_calDwnBgn").ToString()