help: edit datalist itemtemplate with designer

Discussion in 'ASP .Net' started by pel, Sep 16, 2008.

  1. pel

    pel Guest


    can someone refer me to a web site, book, or other resource for learning
    how to edit templates?

    I'm following a book on 2.0. I'm using vsts 2005 team edition.

    it indicates I can use the designer to add controls, etc to the
    templates. I tried dropping a table, text box, etc onto the template.
    one time the table showed up on the page, but not in the datalist.
    another time the textbox just would disappear after trying to position
    in the template area.

    I need help with detail instruction in this area: can you refer me to a
    resource? is this an 05 problem? are you supposed to skip the gui and
    really use the source view and type? is it my lack of html knowledge
    that created the problem? eg I dropped a table onto the template and
    placed it after the last field in the book example

    pel, Sep 16, 2008
    1. Advertisements

  2. pel

    pel Guest

    pel wrote:
    .... it indicates I can use the designer to add controls, etc to the
    I should have specified I'm working with datalist control
    pel, Sep 16, 2008
    1. Advertisements

  3. pel

    vijeta Guest

    when you drag/drop the datalist on the apsx, right click, select edit
    template->Item Templates.
    The datalist will be displayed with the item template/alternating item
    Click in the area below the required template and drag/drop a control
    (say textbox) in that area.
    vijeta, Sep 16, 2008
  4. pel

    pel Guest

    .... select edit template->Item Templates...
    yes. that's what I'm doing. it just doesnt register, or comes out
    wrong. when I add any new control in the designer, it always comes out
    in the top left corner, and I have to drag it into the template box.
    but it doesnt seem to register. if I drag a table into the template
    box, then try to out a control into a table cell, it just forgets when I
    choose end template editing, or gets it wrong.

    Only when I type html directly into the aspx between the itemtemplate
    tags, do I get the results I want.
    pel, Sep 16, 2008
  5. pel

    pel Guest

    the problem was in my visual studio layout settings:

    I had layout/position/autoposition/html designer/css set to absolute.
    this caused that the control appeared correctly placed in template
    editor. but when closed, the control appeared off in left field. I
    thought the control somehow was not registered as inside the template,
    and just fell onto the page. actually in source view, it was correctly
    placed between the template tags.

    I guess at runtime, all the instances of the button were really there,
    one on top of the other.

    anyway I changed to "No positioning attribute", because examples
    directly showing the markup had none. I dropped a new control onto the
    template and worked fine.
    pel, Sep 18, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.