如何将可数据内容显示为链接然后重定向? [英] How to display a datable content as a link and then redirect it?

查看:87
本文介绍了如何将可数据内容显示为链接然后重定向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要获得有关如何在网页上显示我的数据表内容作为链接,然后根据所选内容重定向它的帮助。我有一个数据表,其中包含有关分配给用户的模块的用户详细信息。当用户登录页面时会将这些模块作为链接。例如,如果为用户分配了模块1,3,那么当他登录时,他将有两个链接 1 3 当他点击该链接时,他将被带到所需的页面。

I need to get help on how I can display my datatable content on a webpage as a link and then redirect it according to the selected content. I have a datatable that contains user details about modules assigned to the user . When the user logs in the page will have as links these modules .Example if a user is assigned modules 1,3 ,then when he logs in he will have two links 1 3 and when he clicks that link he is taken to the desired page.

推荐答案

您只需要拆分用逗号(,)分隔的指定模块值并绑定它返回为包含超链接和受尊重网址的字符串..



原始字符串:1,3

读取字符串变量后拆分:1 3等。

结束后的字符串: 1 < ahref = 3.html> 3 .....
You just have to split the assigned modules values separated by comma(,) and bind it back as a string containing hyperlink and respected url..

Original string : 1,3
after reading to string variable split it : 1 3 etc..
String after concating : 1 < a "href=3.html" >3 .....


你可以动态绑定一个html

喜欢

DT =调用getResult(); //假设dt包含ModuleID,Moduledesc

String resHTML =:

Foreach(dt.rows中的datarow dr)

{

resHTML + =+ dr [ModuleID]。toString()+;



}



lblDisplay.text = resHTML;

}

此标签显示链接,这些链接重定向到带有模块ID的ViewDesc.aspx页面as quert string!
You can bind an html dynamically
Like
Dt=GetResult(); //Assume dt contain ModuleID, Moduledesc
String resHTML = "":
Foreach(datarow dr in dt.rows)
{
resHTML +=""+ dr["ModuleID"].toString() +" ";

}

lblDisplay.text = resHTML;
}
This label display a links and these links redirect to the page ViewDesc.aspx with Module ID as quert string !


这篇关于如何将可数据内容显示为链接然后重定向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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