如何搜索和突出显示文本C#和Asp.net [英] how to search and highlight text c# and Asp.net

查看:73
本文介绍了如何搜索和突出显示文本C#和Asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友们...
正在使用XML使用CMS站点Cms进行工作,每个页面都从XML中获取内容...在Aspx页面中,我将该段的ID设置为p1,p2 ..... etc ...
例如...

hi frnds...
Am working with the CMS sites Cms as made by using XML each page is taking content from the XML...in Aspx page i have give id for the paragraph as p1,p2.....etc...
for example...

<div class="scroll">
<p id="p2" runat="server"></p></div>

此标记可从xml中访问该段落的数据...是我在这里需要的想法,该如何使用搜索选项在aspx中搜索并突出显示此xml数据?任何人都可以帮助我...

提前谢谢..
Prem Kumar.A

this tag access the data from the xml for the paragraph...what is the think i need here how can i search and highlight this xml datas in the aspx with the search option...any one please help me...

Thanks in advance..
Prem Kumar.A

推荐答案

*如何将数据从xml提取到标签中?
*为什么需要突出显示xml数据?

如果我错了,请指正我:但是当您单击ctrl + f并键入关键字"hello"时,您要尝试的操作类似于ie-8.并会自动突出显示您页面中找到的所有匹配单词?它不是特定于浏览器的吗?

否则,如果您有自己的搜索按钮(如果您单击搜索按钮并重新加载aspx页面),因为您的页面取决于xml中的数据,我认为在将其记录下来之前,可以将其用span标记括起来并添加背景色.
* how do you pull data from xml to your tags?
* why you need to highlight xml data?

Correct me if i am wrong: but what you are trying to do is like ie-8 when you click ctrl + f and type a key word "hello" and it will automatically highlight all matching word found in your page? isn''t it browser specific?

Otherwise if you have own search button if you click search button and reload your aspx page since your page depends on the data from your xml i think before writing it down you can enclosed it with span tag and add background color.


这篇关于如何搜索和突出显示文本C#和Asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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