Click here to Skip to main content
15,891,895 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

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 .....
 
Share this answer
 
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 !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900