简体   繁体   English

从服务器端Asp.net和c#生成书签

[英]Generate Bookmark This from server side Asp.net and c#

Does anyone know how to do something like this. 有谁知道如何做这样的事情。 Lets say I generate on server side using c# link. 可以说我使用c#链接在服务器端生成。 http://www.blah.com/blabla.aspx?test=blah&search=true http://www.blah.com/blabla.aspx?test=blah&search=true

How could I on server side make it so when clicking on it (for now on HTML side i save this link as asp:label it will bookmark it. 在服务器端,如何单击它(现在在HTML端,我如何将此链接另存为asp:label,将其添加为书签)。

Researching online showed solutions on client side by running java script. 在线研究通过运行Java脚本在客户端显示了解决方案。 It appears that solution might be different based on browser. 似乎解决方案可能因浏览器而异。 I am trying to make this work in Firefox, IE, and Chrome. 我正在尝试在Firefox,IE和Chrome中使此工作正常。

But if you know any solution that is fine too. 但是,如果您知道任何解决方案也可以。

Thanks 谢谢

There is nothing you can execute on the server to make this happen on the client as bookmarking a website is a feature of the browser client. 您无法在服务器上执行任何操作以使此操作在客户端上发生,因为为网站添加书签是浏览器客户端的功能。 You can, as you have discovered, use javascript on the client to automate this on the client. 您已经发现,可以在客户端上使用javascript在客户端上自动执行此操作。

If you want to do this simply (and cross browser), you could use jquery and a jquery plugin. 如果要简单地(和跨浏览器)执行此操作,则可以使用jquery和jquery插件。 One such plugin is JFav . JFav就是这样的插件。 This will bring up the save bookmark dialogue with the link and title from the hyperlink. 这将显示带有超链接中的链接和标题的保存书签对话框。

Careful that you don't abuse your power on the client's browser. 注意不要滥用客户端浏览器的功能。 I for one do not use built-in bookmarks (preferring Delicious), and would not appreciate this behavior. 我一个人不使用内置书签(更喜欢Delicious),并且不喜欢这种行为。

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

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