如何读取值输入型= QUOT;日期和QUOT;写数据库? [英] How to read value input type="date" for writing Database?

查看:122
本文介绍了如何读取值输入型= QUOT;日期和QUOT;写数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题,即读值<输入类型=日期ID =数值指明MyDateRUNAT =服务器/> 它不喜欢阅读类似的文本框像 textbox1.text 。如何能我得到的价值?

I have problem that to read value <input type="date" id="mydate" runat=""server/> it is not like to read similar textbox as like textbox1.text .How can I get the value?

推荐答案

由于你没有提到你的框架,我假设你使用的框架4。

As you didnt mentioned your Framework , i'm assuming your using framework 4 .

因此​​,对于框架4及以上的,允许你指定type属性。

So for Framework 4 and above, allows you to specify the type attribute.

请参阅此链接

请参阅功能3

特点3

新的语法让你定义一个TextBox控件是HTML5兼容。
  例如,下面的code定义了一个TextBox控件是
  HTML5兼容的:

New syntax lets you define a TextBox control that is HTML5 compatible. For example, the following code defines a TextBox control that is HTML5 compatible:

&LT; ASP:文本框=服务器TYPE =一些-HT​​ML5型/&GT;

更新

如果您使用的是框架的旧版本这里是围绕

if you are using Older version of Framework here is work around

.aspx的

<input type="text" ID="txt1" runat="server"/>

的.cs

string date = Request.Form["txt1"];

这篇关于如何读取值输入型= QUOT;日期和QUOT;写数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆