How to bind div at runtime? [Resolved]

Posted by Nishant_Mittal under C# on 2/1/2013 | Points: 10 | Views : 974 | Status : [Member] | Replies : 1
I have a div, and want to bind ul li inside that div from C# code?




Responses

Posted by: Ranjeet_8 on: 2/1/2013 [Member] [MVP] Gold | Points: 50

Up
0
Down

Resolved
Try this,
Add this tag on ASPX Page.
 

<div id="divContentHolder" runat="server" >
</div>

Write this code on ASPX.CS Page

for (int i=0; i<5; i++)
{
sb.Append("<div class='YourCSS-Class'>");
sb.Append("Your Content goes here...");
sb.Append("</div>");
}
divContentHolder.InnerHtml = sb.ToString();


Please Mark As Answer if this helps you

.

Nishant_Mittal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response