Click here to Skip to main content
15,909,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HyperLink hlRow = new HyperLink();
hlRow.Style.Add("color", "#000000");
hlRow.Style.Add("text-decoration", "none");

how can i let it appear in the webpage??
because i need to make a for loop to add some hyperlinks to the page while execution, but i couldn't do that, although i can define a hyperlink through C# code behind class but when i execute the code nothing appears to the webpage !!! could someone help me please...
Posted
Comments
Sunasara Imdadhusen 9-Feb-11 0:24am    
Please provide snippet of code!!

1 solution

Hi,

In your aspx page define a container first.

XML
<div  runat="server" id="myHyperlink">
</div>


Then use add it like this from code behind
HyperLink hlRow = new HyperLink();
hlRow.NavigateUrl="http://www.google.com";
hlRow.Text = "Google";
hlRow.Visible = true;
hlRow.Style.Add("color", "#000000");
hlRow.Style.Add("text-decoration", "none");

this.myHyperlink.Controls.Add(hlRow);
 
Share this answer
 
Comments
shadi_abushaar 9-Feb-11 1:00am    
Thank You Boss...

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