文本已更改事件自动触发 [英] text changed event fired automatically
本文介绍了文本已更改事件自动触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨专家......
我有文字更改事件的问题..它自动调用。所以页面多次刷新..
请帮我做什么..我在这里发布我的代码
提前感谢..
Hi experts...
i have a problem with text changed event.. its calling automatically. so page is refreshing multiple times..
please help me what to do.. i post my code here
thanks in advance..
<asp:TextBox ID="txtDate" CssClass="app_formtext" runat="server" AutoPostBack="True"
OnTextChanged="txtDate_TextChanged" MaxLength="10"
ValidationGroup="check" Height="22px" Width="100px"
></asp:TextBox>
在我的页面加载中我写了
in my page load i write
txtDate.text = DateTime.Now.ToShortDateString();
请帮助我。 ..
please help me...
推荐答案
尝试在ajax更新面板中添加你的控件并试一试..
Try to add your control in ajax update panel and try it..
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:TextBox ID="txtDate" CssClass="app_formtext" runat="server" AutoPostBack="True"
OnTextChanged="txtDate_TextChanged" MaxLength="10" ValidationGroup="check" Height="22px"
Width="100px"></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="txtDate" />
</Triggers>
</asp:UpdatePanel>
参考:http://msdn.microsoft.com/en-us/library/bb399001.aspx [ ^ ]
ASP.NET中的Updatepanel(Ajax) [ ^ ]
这篇关于文本已更改事件自动触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文