开发者

Firing event when TextBox is blank

开发者 https://www.devze.com 2023-04-06 03:53 出处:网络
I need to fire an event whe开发者_开发问答n a TextBox in ASP.NET has been defocused - I currently handle the TextChanged event for this, but this obviously doesn\'t fire if they don\'t type into the b

I need to fire an event whe开发者_开发问答n a TextBox in ASP.NET has been defocused - I currently handle the TextChanged event for this, but this obviously doesn't fire if they don't type into the box and then defocus. Can I do this?

EDIT: To clarify, I want to fire a server side event - not client side


$('input').blur(function() {
   if ($(this).val() == ''){
      __doPostback('MyMethod')
   }
});

protected void MyMethod()...
0

精彩评论

暂无评论...
验证码 换一张
取 消