public static List<TemplateInfo> GetTemplateList()
{
DirectoryInfo dir = new DirectoryInfo("E://DotNetProjects//sftemplating//Templates");
List<TemplateInfo> lstTemplates = new List<TemplateInfo>();
foreach (DirectoryInfo temp in dir.GetDirectories())
{
TemplateInfo tempObj = new TemplateInfo(temp.Name);
lstTemplates.Add(tempObj);
}
return lstTemplates;
}
and
public void BindTemplate()
{
ddlTemplateList.DataSource = GetTemplateList();
ddlTemplateList.DataBind();
}
info is
public class TemplateInfo
{
public string TemplateName { get; set; }
public TemplateInfo() { }
public TemplateInfo(string TemplateName)
{
this.TemplateName = TemplateName;
}
}
and i call BindTemplate in pageload like this
if (!IsPostBack)
{
BindTemplate();
}
but ddlTemplateList is bind with Templating.TemplateInfo.Templating is my namespace.Whats my problem.Plz help to find my mistake.