将jquery代码转换为c#以在gridview中搜索和显示所选值 [英] Convert jquery code into c# to search and display selected values in gridview

查看:38
本文介绍了将jquery代码转换为c#以在gridview中搜索和显示所选值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$('[id*=btnSearch]').on("click", function () {

            var sSearchTerm = "1045";
            var list = "";

            $("#<%=dgv_Report.ClientID%> tr:has(td)").each(function () {
                var cell = $(this).find("td:eq(1)").html();
                if (cell == sSearchTerm) {
                    $(this).parent().hide();
                    return true;
                }

            });
        });







当我使用此代码时,页面会刷新,它不会隐藏GridView的行。所以请告诉我如何在c#




When I use this code, Page get refreshed and it wont hide rows of GridView. So please let me know how to convert above code in c#

推荐答案

中转换上面的代码(' [id * = btnSearch]')。on( click,function(){

var sSearchTerm = 1045;
var list = < span class =code-string>;
('[id*=btnSearch]').on("click", function () { var sSearchTerm = "1045"; var list = "";


#<%= dgv_Report.ClientID%> tr:has(td))。each(function(){
var cell =
("#<%=dgv_Report.ClientID%> tr:has(td)").each(function () { var cell =


this )。find( < span class =code-string> td:eq(1))。html();
if (cell == sSearchTerm){
(this).find("td:eq(1)").html(); if (cell == sSearchTerm) {


这篇关于将jquery代码转换为c#以在gridview中搜索和显示所选值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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