在usercontrol中使用javascript [英] Using javascript in usercontrol
问题描述
您好我在c#中创建了usercontrol,这是基于TextBox Control的EditableDropdownList。
使用这个控件创建webusercontrol以避免每次调用jquery脚本时调用。
工作正常。但在我的网页中,我想限制允许数值。所以我在该页面中创建了javscript函数。我打电话使用onkeydown功能。但它没有用。
如果我调用javascript函数webusercontrol本身,它正在工作。但是我想调用.aspx页面,因为我需要那个页面调用javascript函数。
任何人都可以解决这个问题。
Hi i have created usercontrol in c# Which is EditableDropdownList based on TextBox Control.
Using this control i m creating webusercontrol for avoid to call every time calling jquery script.
It is working fine. But in my web page, i want to restrict allow numeric values. so i m creating javscript function within that page. And I m called using onkeydown function. But it is not working.
If I call javascript function webusercontrol itself, it is working. But I want to call .aspx page, because i call javascript function if it needs that page.
Any one can clear this problem.
推荐答案
如果您只想限制文本框控件只接受数字..您可以使用FilteredTextBox Extender。
< asp:FilteredTextBoxExtender id =FilteredTextBoxExtender50runat =serverfiltertype =Numberstargetcontrolid =TxtBox>
If you just want to restrict textbox control to accept numbers only .. you can use FilteredTextBox Extender.
<asp:FilteredTextBoxExtender id="FilteredTextBoxExtender50" runat="server" filtertype="Numbers" targetcontrolid="TxtBox">
这篇关于在usercontrol中使用javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!