I have one single page in my ASP project, where upon clicking a different link, I retrieve ,from the database, the according HTML and load it. So I have some links, that are sitting in the page at all time (the part of the HTML that is not retrieved from the DB) but in some divs I get the HTML, and in there I also have links, that I'd like to run as ASP LinkButton controls.
This is, f.e., that always stays:
<div id="mainCenter">
<asp:Literal ID="ltlContentCenter" runat="server" />
</div>
So in my code behind I have this:
protected void Page_Load(object sender, EventArgs e) {
ltlContentCenter.Text = getPageCenter("media");
ltlContentSide.Text = getPageSide("media");
}
What I have in the DB, corresponding, is:
<div class="onCenterSmall">
<asp:LinkButton ID="LinkButton10" Text="test" CommandArgument="test" OnCommand="loadPage_Command"
runat="server" />
</div>
<div class="onCenterSmall"></div>
<div class="onCenterSmall"></div>
That chunk of HTML just gets put in between the
<div id="mainCenter"><!--</div>
on the page. And as you can see by yourself I get the result as string. For the HTML code that's fine, but for the
<asp:LinkButton...>
that doesn't quite work. Any suggestions how I can do all the work in the same way (or at least to preserve the logic) but to get the LinkButton control working ?