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

时间:2022-05-08 15:23:52

Does anyone know how to do something like this. Lets say I generate on server side using c# link. http://www.blah.com/blabla.aspx?test=blah&search=true

有谁知道如何做这样的事情。假设我在服务器端使用c#link生成。 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. It appears that solution might be different based on browser. I am trying to make this work in Firefox, IE, and Chrome.

在线研究通过运行java脚本在客户端显示解决方案。似乎解决方案可能因浏览器而异。我想在Firefox,IE和Chrome中完成这项工作。

But if you know any solution that is fine too.

但是,如果你知道任何解决方案也很好。

Thanks

1 个解决方案

#1


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. One such plugin is JFav. This will bring up the save bookmark dialogue with the link and title from the hyperlink.

如果你想简单地(和跨浏览器)这样做,你可以使用jquery和jquery插件。一个这样的插件是JFav。这将显示带有超链接的链接和标题的保存书签对话框。

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.

小心不要滥用客户端浏览器的电源。我一个人不使用内置书签(更喜欢美味),并不会欣赏这种行为。

#1


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. One such plugin is JFav. This will bring up the save bookmark dialogue with the link and title from the hyperlink.

如果你想简单地(和跨浏览器)这样做,你可以使用jquery和jquery插件。一个这样的插件是JFav。这将显示带有超链接的链接和标题的保存书签对话框。

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.

小心不要滥用客户端浏览器的电源。我一个人不使用内置书签(更喜欢美味),并不会欣赏这种行为。