数据库中的超链接 [英] hyperlink in database

查看:393
本文介绍了数据库中的超链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我单击超链接时,我试图从表行中提取所有内容.
因此可以将超链接放入数据库表中吗?
示例:

我有一个策略表,其中有一个策略ID和策略名称作为两个字段.
因此,此策略连接到通过一对多关系连接的标准表(字段是标准编号和标准url).因此,我将该标准URL放入数据表中,因此该策略具有许多标准,我将它们放入其中在数据表中,当我单击它时,通过填充标准内容字段来打开标准文档.

可以通过将超链接保留在数据库表中来完成此操作.

I am trying to pull all the content from the table row when I click the hyperlink.
So can I put the hyperlink in the database table.
EXAMPLE:

I have a policies table which has a policy ID and policy name as two fields.
So this policy is connected to a standards table(fields are standard number and standard url) which is connected by one-many relation.So I am putting this stanadrd URL in to the datatable.So the policy has many standards which I will put them in datatable and when I click it the standard document gets opened by populating the standard content fields.

Can this be done by keeping the hyperlink in to the database table.

Any suggestions or advice?

推荐答案

您不需要将超链接保留在数据库中.

1.如果要将数据绑定到 GridView ,则可以将 PolicyID 绑定到一列中,并且还可以将其设为 DataKey GridView .

2.然后,您可以在一个 ItemTemplate 中包含超链接.

3.之后,您在GridView onRowCommand 事件中进行了一些编码....

4.您必须使用e.CommandArgument来获取选定的行号,并使用该行号可以找到对应的 Datakey 值,该值是该特定行的 PolicyID .

5.获取 PolicyID 后,您可以轻松地从数据库中提取该ID的数据.

请参考使用GridView和RowCommand事件 [
You don''t need to keep the hyperlink in Database.

1. If you are binding the data to a GridView, then you can bind the PolicyID in one column and also u can make it DataKey of GridView.

2. Then you can have the hyperlink inside one ItemTemplate.

3. After that u have do some coding in GridView onRowCommand Event....

4. You have to use e.CommandArgument to get the selected row number and using the row Number you can find the corresponding Datakey Value which is the PolicyID for that particular row.

5. After getting the PolicyID, you can easily pull data from database for that ID.

Refer Using GridView and RowCommand Events[^] for one example.

I have shared the idea and logic how to do the task.
Now you have to implement that.
Please try to implement and come back with your codes, if you face any issues.

Thanks...


您可以将URL放入表的列中.

但是,如果您要问是否可以将一些元数据对象树(无论表示形式)放在一列中,那么基本上答案是否".
You can put a url into a column into a table.

If however you are asking if you can put some meta-data object tree (regardless of representation) into a column then basically the answer is no.


这篇关于数据库中的超链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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