vb.net - 引用 system.web.ui 而不是 system.web.forms
问题描述
我有个问题。
我想在过滤器中捕获事件 KeyPress 。
<div class="row rowMarginTop ">
<div class="col-xs-12 col-md-7">
<asp:Panel ID="pnlFilterCategory" runat="server" Visible="True">
<asp:Label runat="server" ID="lblFilterCategory" Text="Rechercher une catégorie"></asp:Label>
<asp:TextBox runat="server" ID="txtFilterCategory"></asp:TextBox>
<asp:Button runat="server" ID="btnFilterCategory" Text="Rechercher" CssClass="btn btn-primary" />
</asp:Panel>
</div>
但是在我后面的代码中我没有找到 KeyPress
Protected Sub txtFilterCategory_KeyPress(sender As Object, e As Global.System.Windows.Forms.KeyEventArgs) Handles txtFilterCategory.KeyPress
If Not String.IsNullOrEmpty(txbFilterProduit.Text) Then
Session("FilterExpression") = txbFilterProduit.Text
End If
RadTreeListF07.Rebind()
End Sub
我认为这是因为对于我的 txtFilterCategory 它说“Protected WithEvents txtFilterCategory As System.Web.UI.WebControls.TextBox Contrôle txtFilterCategory”
所以它不是 system.windows.form 的参考,我认为这是我的问题。
我的进口是
Imports System.Windows.Forms
Imports Telerik.Web.UI
Imports System.Data
Imports System.Collections.Generic
Imports System.Xml
Imports System.Web.Configuration
Imports System.IO
Imports System
Imports System.Web
所以我的问题是在我的代码隐藏中捕获 KeyPress 的方法是什么?
对不起我的英语我是法国人和初学者。
解决方案
推荐阅读
- sql - 无法解决这个涉及给定电影数据库子查询的 SQL 查询
- javascript - 是否可以有 2 个渐变背景?
- node.js - 在 nodejs child_process 中将烧瓶应用程序作为可执行文件执行
- github - 如何在允许提交之前对 GitHub 分支强制执行代码质量规则?
- mysql - 为什么在执行此 SQL 查询时会出现重复的列?
- pyspark - ADLS Gen 1 中 DELTA 格式文件的外部表
- android - FLUTTER:当 image_picker 添加为依赖项时,发布安装中缺少插件
- excel - 如何在两列中使用 excel 函数或 VBA 获取准确值
- arduino - 主机名以“.local”结尾的 ESP8266 DNS 查找
- cypress - Cypress 测试点击另一个页面中的按钮后返回登录页面