放置在数据列表中的超链接按钮单击事件代码 [英] hyperlink button click event code which is placed in datalist

查看:132
本文介绍了放置在数据列表中的超链接按钮单击事件代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我正在使用数据列表显示记录.每条记录都有一个图像和一个指向更多信息的超链接.现在,我需要超链接navigationUrl具有两个参数.一个用于userId,第二个用于userName.为了找出单击了哪个记录的超链接,还必须包含该记录的键.因此,如何基于记录键创建URL,该记录键还包含用户ID和用户名作为参数,并将NavigationUrl设置为超链接.

注意:我不想使用linkBut​​ton而不是超链接,因为它无法在新窗口和新标签页中打开,并且Google无法从链接按钮获取URL,因此请不要建议使用链接按钮.

Hello everyone!
I am using a Datalist to display records. Each record has an Image and a hyperlink to more information. Now I need that hyperlink navigateUrl have two parameters. One for userId and second one for userName. To find out which record''s hyperlink was clicked the key for the record also has to be included. So how do I create an URL based on the records key that also contains the users id and name as parameters and set navigateUrl to the hyperlink.

Note: I don''t want to use linkButton instead of hyperlink, because it''s unable to open in new window and new tab and Google is unable to get the URL from a link button, so please don''t suggest the use of a link button.

Thanks in advance for your replies!

推荐答案

尚不清楚为什么记录ID也不能附加在查询字符串中,因为每条记录都显示一个超链接. br/>
在url字符串中传递用户ID可能并不安全.请参阅本文,以获取有关如何安全传递查询字符串参数的更多信息.

URL伪造的预防方法-以ASP.NET MVC为例 [
It is not clear why can''t the record id also append in the query string as each record display a hyperlink.

It may not be safe to pass the user id in the url string. Refer this article for further information how to securely pass the query string parameters.

Preventive Method for URL Request Forgery- An Example with ASP.NET MVC[^]


这篇关于放置在数据列表中的超链接按钮单击事件代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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