I have a string stored in DB as "<asp:panel id='test' runat='server' ></asp:panel>".
I am trying to get this data and put it in a div which have runat="server" in it using innerHtml property.
protected void Page_Load(object sender, EventArgs e)
{
Layouts.InnerHtml = GetTemplate();
}
public string GetTemplate()
{
CompassModel.Layout Layout;
using (CompassEntities db = new CompassEntities())
{
Layout = (from q in db.Layouts
where q.LayoutID == 1
select q).SingleOrDefault();
}
return Layout.LayoutHTML;
}
when I am trying to access this dynamically added panel using findcontrol() method it returns null.
Is there any way to render it so that I can access panel at the runtime?
<asp:panel id='test' runat='server' ></asp:panel>in DB and add it in other control? What are you trying to solve?HTML. Howver you are simply putting more load(DB Call) and trying to make your site heavier. Start useAjax