Hi,
I want dynamical add HTML on my div. I do this with:
newsAllScroller.InnerHtml = newsAllScroller.InnerHtml + "<br><center><b>";
List<DAL.News> newsList = DAL.NewsHandler.GetAllNews();
foreach (DAL.News n in newsList)
{
newsAllScroller.InnerHtml = newsAllScroller.InnerHtml + "<br>" + n.Betreff + " - ("
+ "<asp:HyperLink ID=\"news"+n.NewsID+"\" runat=\"server\" NavigateUrl=\"~/News.aspx?id=" + n.NewsID + "\""
+ " CssClass=\"newsLink\">"
+ "..."
+ "</asp:HyperLink>"
+ ")";
}
newsAllScroller.InnerHtml = newsAllScroller.InnerHtml + "</center></b>";
The HyperLink is not working (you cannot click it).
When I copy the hyperlink from the browser-source-code into an aspx-page it works, so it seems the syntax is all correct - but it doasn't work via code, why?