Hi all,
Let me say firstly, that i am very new to ASP (soon to become very obvious). I started out this current thing by following a tutorial to craft a simple trading post, by Michael Washington. And have since modified it to suit my purposes.
Basically, i have a datalist, and within each itemtemplate is also a "add link" button that displays (sets .visible = true) a form below the full data list. within each itemtemplate is also a Label containing the ID of the current record being displayed. How is it possible to transmit this ID to the form outside the datalist, it appears i have no "selected index" etc to work with when its a datalist.
This is probably wrong, but i took note in the sample, that a Class was built to hold the data for use, and connected to with an object datasource. Basically i have had to add a separate table, as entries in the main table, can have multiple related entries in the other table. I was not sure whether it was possible or advisible to modify the class to contain a ... sub class? and populate that in some fashion (or how to do so), so i simply created a separate class, and i populate it with the data for each entry in the main class... this is wher ethe problem is... the link between the Data in the main table is a foreign key ID in the second table, To populate my second class, and of course to run the insert to add to the 2nd table, i need to access the Correct ID from the original Class, to pass as the value for the foreign key (Where ID = @ID) etc...
Datalist doens't seem overly friendly in terms of indexing a selected data entry...
I apologise in advance if none of this makes sense, i haven't got much background with object oriented programing obviously, and am tackling it 'from the deep end' so to speak:). Any advice on how to achieve this is great, i figure i could use a postback to the same page, however i'd rather redesign the class structure than do that, it would seem the wrong way to go about it.
Any help greatly appreciated:)