Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datalist won't display

Datalist won't display

Scheduled Pinned Locked Moved ASP.NET
visual-studiosysadminwindows-adminworkspace
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jboyd111
    wrote on last edited by
    #1

    Hello, I've been working on an e-commerce site for a couple of weeks. I'm at a point where I want to use a datalist to display a subset of my catalog. Well, nothing in the datalist displays when I bring up the page in IE with either IIS 7 or VS built-in iis server. I've isolated a simple piece of code that illustrates my dilemna within a defalut.aspx file: <form id="form1" runat="server"> <div> <asp:DataList ID="DataList1" runat="server"> <ItemTemplate> Hello! </ItemTemplate> </asp:DataList> </div> </form> This page should show: "Hello", yet the page is blank. More configuration details: - running Windows 7 - VS 2008 - IIS 7 Any assistance or suggestions to point me in the right direction would be greatly appreciated. Thanks in advance.

    V 1 Reply Last reply
    0
    • J jboyd111

      Hello, I've been working on an e-commerce site for a couple of weeks. I'm at a point where I want to use a datalist to display a subset of my catalog. Well, nothing in the datalist displays when I bring up the page in IE with either IIS 7 or VS built-in iis server. I've isolated a simple piece of code that illustrates my dilemna within a defalut.aspx file: <form id="form1" runat="server"> <div> <asp:DataList ID="DataList1" runat="server"> <ItemTemplate> Hello! </ItemTemplate> </asp:DataList> </div> </form> This page should show: "Hello", yet the page is blank. More configuration details: - running Windows 7 - VS 2008 - IIS 7 Any assistance or suggestions to point me in the right direction would be greatly appreciated. Thanks in advance.

      V Offline
      V Offline
      Vimalsoft Pty Ltd
      wrote on last edited by
      #2

      on page loadon the server side , you are missing the following code

      DataList1.DataBind();

      Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

      J 1 Reply Last reply
      0
      • V Vimalsoft Pty Ltd

        on page loadon the server side , you are missing the following code

        DataList1.DataBind();

        Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

        J Offline
        J Offline
        jboyd111
        wrote on last edited by
        #3

        I apologize, I knew there was something I left out. This is what I had in the code-behind: protected void Page_Load(object sender, EventArgs e) { DataList1.DataBind(); } So, I have a "Default3.aspx" file with the DataList1 control, and a "Default3.aspx.cs" file with the DataBind() call.

        M 1 Reply Last reply
        0
        • J jboyd111

          I apologize, I knew there was something I left out. This is what I had in the code-behind: protected void Page_Load(object sender, EventArgs e) { DataList1.DataBind(); } So, I have a "Default3.aspx" file with the DataList1 control, and a "Default3.aspx.cs" file with the DataBind() call.

          M Offline
          M Offline
          Manas Bhardwaj
          wrote on last edited by
          #4

          jboyd111 wrote:

          DataList1.DataBind();

          That's OK, but you need to tell the datasource from where the data is to be used.

          Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups