L
Lewis
Hey!
Wondering if anyone can help!
I have been trying to build an aspx page which builds a list of records from
a database. Having been doing this using xml and xslt using asp for years
with no problems this particular page had some functionality which I thought
could be well suited to a data list control.
Maybe I'm misunderstanding how this control is supposed to work but it
doesn't do what I'm expecting!
Here's what I did: (briefly)
* added the connection, adapter and dataset (creating the xsd as well) to my
aspx page.
* previewed the dataset (all OK)
* added the data list to the page.
* edited the 'tem' template - and added a literal control.
* set the datalists's datasource to be my dataset
* bound the literal control to a column in my dataset
* added the code to fill the dataset and bind everything on the page to its
databindings
The page compiled OK and when viewed it had 16 literal controls (the same
amount of records as is in my table) : but all controls had the value from
the first row of my table.
After trying to figure this out I decided to check that the number of
records wasn't just a coincidence so I removed all but two records - the
page then showed just two literal controls!
I have successfully got this working with a datagrid but a datalist suits my
needs more appropriately. Am I misunderstanding how the datalist control is
supposed to work?
Wish Id used XML / XSLT to start off with now. : (
Thanks in advance for the help!
Lewis
Wondering if anyone can help!
I have been trying to build an aspx page which builds a list of records from
a database. Having been doing this using xml and xslt using asp for years
with no problems this particular page had some functionality which I thought
could be well suited to a data list control.
Maybe I'm misunderstanding how this control is supposed to work but it
doesn't do what I'm expecting!
Here's what I did: (briefly)
* added the connection, adapter and dataset (creating the xsd as well) to my
aspx page.
* previewed the dataset (all OK)
* added the data list to the page.
* edited the 'tem' template - and added a literal control.
* set the datalists's datasource to be my dataset
* bound the literal control to a column in my dataset
* added the code to fill the dataset and bind everything on the page to its
databindings
The page compiled OK and when viewed it had 16 literal controls (the same
amount of records as is in my table) : but all controls had the value from
the first row of my table.
After trying to figure this out I decided to check that the number of
records wasn't just a coincidence so I removed all but two records - the
page then showed just two literal controls!
I have successfully got this working with a datagrid but a datalist suits my
needs more appropriately. Am I misunderstanding how the datalist control is
supposed to work?
Wish Id used XML / XSLT to start off with now. : (
Thanks in advance for the help!
Lewis