如何使用asp.net隐藏Masked编辑扩展器默认值( - : - ) [英] how to hide Masked edit extender default value (--:--) using asp.net

查看:55
本文介绍了如何使用asp.net隐藏Masked编辑扩展器默认值( - : - )的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在Web应用程序中工作。我有控件在文本框中输入开始时间和结束时间,我使用ajax:Masked编辑扩展器进行验证,

我的问题在scenario1中,

我输入了值在开始时间说11:12,按Tab键,焦点将在End字段中。现在我在数据库中节省价值这样的时间值节省 - : -

如何解决这个问题,请给出任何解决方案。



问题:在数据库中保存值 - : -



o / p我需要:如果我在数据库中保存空数据我需要保存空值



Follwing是我的代码,

 <   asp:TextBox     ID   =  txtReturnArrivalTime    CssClass   =  form-control form-control-width          MaxLength   =  50    runat   =  server    /  >  

< ajaxtoolkit:MaskedEditExtender ID = MaskedEditExtender4 runat = server < span class =code-attribute> 掩码 = 99:99 CultureAM PMPlaceholder = CultureCurrencySymbolPlaceholder =

CultureDateFormat = CultureDatePlaceholder = CultureDecimalPlaceholder = CultureThousandsPlaceholder = CultureTimePlaceholder = 已启用 = True 自动完成 = 错误 MaskType = 时间 TargetControlID = txtReturnArrivalTime >
< / ajaxtoolkit :MaskedEditExtender >







i非常需要我。请尽快给我指导。



谢谢和问候,

Ramu,

解决方案

亲爱的Ramu,



检查后面的代码 - 如果你得到 - : - 然后使用

 DBNull.Value 

它会在你的表格栏中保存null。



谢谢


Hi ,

I am working in Web application. I am having controls to enter Start time and End time in text boxes, I used ajax:Masked edit extender for validation ,
My issue is in scenario1,
I have entered value say 11:12 in Start hours and I press tab, the focus will be in End field. Now am saving value in database that time value saving like this --:--
How to slove this issue , Please give any solution.

Issue: in database value saving --:--

o/p I need: if i save empty data in database i need to save null value

Follwing is my code,

  <asp:TextBox ID="txtReturnArrivalTime" CssClass="form-control form-control-width"    MaxLength="50" runat="server" />

<ajaxtoolkit:MaskedEditExtender ID="MaskedEditExtender4" runat="server" Mask="99:99" CultureAMPMPlaceholder="" CultureCurrencySymbolPlaceholder=""

CultureDateFormat="" CultureDatePlaceholder="" CultureDecimalPlaceholder="" CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True"  AutoComplete="False"  MaskType="Time" TargetControlID="txtReturnArrivalTime">
 </ajaxtoolkit:MaskedEditExtender>




i am very needful to me.,please guide me ASAP.

Thanks&Regards,
Ramu,

解决方案

Dear Ramu,

Check in code behind if you are getting --:-- then use

DBNull.Value

it will save null in your table column.

Thanks


这篇关于如何使用asp.net隐藏Masked编辑扩展器默认值( - : - )的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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