如何获取超文本作为文本? [英] How to get hyperlink as text?

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

问题描述

亲爱的朋友们,



我正在开发一个拥有用户所有记录的网络应用程序。配置文件管理存在问题。我想创建一个页面,显示数据库中所选用户的所有只读信息。我不想为每个成员分配一个唯一的URL。请参阅以下示例:



haseeb正在与john合作



在上面的示例中,haseeb和john应该是第三个用户可以点击的超链接。当用户单击时,页面将被重定向到配置文件查看器页面(例如profile.aspx),该页面显示所有详细信息。换句话说,我想创建一个通用页面。



如何将超链接作为文本获取,以便我用用户名检索数据。



请帮帮我为了解决这个问题,我将非常感谢你。



问候,

Dear Friends,

I am working on a web application having all the records of user. There is a problem in profile management. I want to create a single page which shows all the read-only information about the selected user from the database. And I don''t want to assign each member a unique URL. See the following example:

haseeb is working with john

In the above example, haseeb and john should be the hyper-links on which the 3rd user will able to click. When the user click, the page will be redirected to the profile viewer page (say profile.aspx) which shows all the details. In other words, I want to create a generic page.

How can I get hyperlink as text so that I retrieve data w.r.t username.

Please help me to solve this problem, I will be very thankful to you.

Regards,

推荐答案

这是一个非常简单的答案。切割面包的方法有很多种,但最简单的就是你必须把John和& Haseeb从某个地方命名。你形成或写出你的超链接,使它看起来像这样

Profile.aspx?usr = John> John在这种情况下,当用户点击John时,他们将被重定向到个人资料页面,使用querstring usr = John,以便您的个人资料页面可以读取该值并拉出Johns Profile。



您的另一个选择是放置链接按钮控件< asp:linkbutton xmlns:asp =#unknown>

然后你可以填充,John& Haseeb或服务器端的任何名称。当用户点击任一名称时,整个页面将回发给自己。然后在你的Onclick事件中,您可以执行Server.Transfer或Response.Redirect到任何传递任何您想要的信息的页面。



处理QueryStrings等时,请记得清理输入。
This is a pretty simple answer actually. There are many ways to cut the bread on this, but the most simple is you have to have pulled the John & Haseeb names from somewhere. You form or write out your hyper link so that it looks something like this
Profile.aspx?usr=John>John In this case when the user clicks on John they will be be redirected to the Profile Page, with the querstring usr=John, so that your profile page, can read that value and pull up Johns Profile.

Your other option is to place "link" button controls <asp:linkbutton xmlns:asp="#unknown">
You can then populate, John & Haseeb or whatever name from the server side. When the user clicks on either name the whole page will post back to itself. Then in your "Onclick" event you can do a Server.Transfer or an Response.Redirect to whatever page passing in whatever information you''d like.

When dealing with QueryStrings etc. remember to sanitize your inputs.


这篇关于如何获取超文本作为文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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