help: edit datalist itemtemplate with designer

  • Thread starter Thread starter pel
  • Start date Start date
P

pel

hi,

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

I'm following a book on asp.net 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

Thanks!
 
pel wrote:

... it indicates I can use the designer to add controls, etc to the> templates. ...

I should have specified I'm working with datalist control

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
template...
Click in the area below the required template and drag/drop a control
(say textbox) in that area.
 
.... 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.
 
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.
 
Back
Top