简体   繁体   English

有没有办法用C#在asp.net中的textchanged事件中以编程方式打开引导程序模型?

[英]Is there a way to open programmatically a bootstrap model in a textchanged event in asp.net with c#?

I am recently working on a project where I need to open a boostrap modal, but not from a html button nor a asp button, but from a textbox from asp. 我最近在一个项目中工作,我需要打开一个boostrap模态,但不是从html按钮或asp按钮,而是从asp的文本框。 I have tried a lot of ways, but none of them work, any recommendations about how to do this? 我尝试了很多方法,但是没有一种起作用,有关如何执行此操作的任何建议?

You can use .change event of textbox using jquery to show modal when text changes. 您可以使用jquery使用textbox .change事件在文本更改时显示modal

$('#yourtextboxid').change(function(){
    $('#yourmodalId').modal('show');
});

you can use .change event of a textbox using jquery as follows: 您可以使用jquery使用textbox .change事件,如下所示:

//html code for textbox
<input type="text" id="yourTextBox" runat="server"/>    

//jQuery code 
$('#<%= yourTextBox.ClientID %>').change(function(){
  $('#yourModal').modal('show'); 
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM