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