对于ASP文本框无钥匙preSS事件 [英] No keypress event for asp textbox

查看:94
本文介绍了对于ASP文本框无钥匙preSS事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我需要对ASP文本框,但不适用于ASP文本框键preSS事件的关键preSS事件工作。是否有替代方案可供这个问题? PLZ帮助!

Hello i need to work on keypress event of asp textbox but keypress event not available for the asp textbox. Is there alternative available for this problem? Plz help!

推荐答案

请使用JavaScript关键preSS事件+文本框

Make use of keypress event of javascript + textbox

和使用A​​JAX或使用pagemthods调用服务器端功能。

and call the serverside function by using ajax or using pagemthods.

.cs file
[ScriptMethod, WebMethod]

   public static string docall()
   {
      return "Hello";
   }

.aspx file

<script type="text/javascript">
      function btnAccept_onclic() {
          PageMethods.docall(onSuccess, onFailure);
      }

  function onSuccess(result) {
          alert(result);
      }


      function onFailure(error) {
          alert(error);
      } 

</script>

检查:的http://blogs.microsoft.co.il/blogs/gilf/archive/2008/10/04/asp-net-ajax-pagemethods.aspx

这篇关于对于ASP文本框无钥匙preSS事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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