如何从浏览器获取选定的文本. [英] How to get the Selected Text form a Browser.

查看:107
本文介绍了如何从浏览器获取选定的文本.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友.
谁能告诉我如何从任何
中获取选定文本?
c#中的浏览器(IE,Fire Fox等).请帮帮我.

由于

Dear Friends.
can anyone tell me how to get the Selected text form any

Browsers ( IE, Fire Fox etc ) in c#. Please help me.

Thanks

推荐答案

无法在Server的CodeBehind文件中获取Selected值.但是,可以通过JavaScript获取所选文本(通过Mouse KeyBoard).如果需要在CodeBehind文件中获取选定的值,则可以将选定的文本设置为隐藏字段(使用Javascript),这将使您在将表单提交(或回发到)服务器时获得该值.

如果您使用的是Google,则将获得一些JQuery插件,用于获取所选文本.此 http://perplexed.co.uk/1020_text_selector_jquery_plugin.htm [
It is not possible to get the Selected value in the CodeBehind file at Server. But, it is possible to get the selected text (By Mouse or KeyBoard) by JavaScript. If you need to get the selected value in CodeBehind file, you can set the selected text into a hidden field (Using Javascript) and this will let you get the value when the form is submitted (Or, Posted back) to Server.

You will get a few JQuery plugin for getting the Selected text if you Google. This http://perplexed.co.uk/1020_text_selector_jquery_plugin.htm[^] might help you.


不,我想用c#来做


这篇关于如何从浏览器获取选定的文本.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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