c# - Load different ascx file to DataList -


i have datalist item load different user control code behind.

<%@ control language="c#" autoeventwireup="true" codebehind="textquestion.ascx.cs" inherits="questionnaireui.textquestion" %> <div>  name: <asp:label id="categorynamelabel" runat="server"            text='<%# eval("description") %>'>       </asp:label>       <input type="text" /> </div> 

the line supposed add user control alternating template

dlsubjects.alternatingitemtemplate = page.loadtemplate("textquestion.ascx"); 

this idea taken msdn library no matter cant see user control in page no in page source after page has loaded. thank you

another dynamic way insert 1 literal control datalistitem template, on other hand, wrap control in empty aspx page, , in code behind, add iframe literal,

yourliteral.text="<iframe src='externalcontrol.aspx'></iframe>"; 

this give ability pass querystring parameters.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -