Accessing dropdownlists in a datalist control

G

Guest

I am trying to develop a tape management application which tracks backup
tapes for 3 servers. I need to be able to add new tapes and retire old/bad
tapes. I also need to track the location of the tapes between three
locations, the 'In Service Date' of each tape, and number of times each tape
has been loaded into its server.
So far I have three tables, one for tape mgmt (serverID, TapeID and 'In
Service Date'), one for tape status (TapeID, Status, Date) and one for
retired tapes (TapeID, RetireCode, RetiredBy, Date). I have everything
working except for the capability of updating the status of the tapes (and
Retiring tapes, but if I can get this working then I can do it).

Right now I am using a datalist (so I can display two columns - 50+ tapes at
a time) to display the tapes for a server depending on which radiobutton
(autopostback) the user clicks. The datalist has one ItemTemplate.

<ItemTemplate>
< %# PadTapeID(DataBinder.Eval(Container.DataItem,"TapeID")) %>

<asp:DropDownList ID="ddlTapeStatus" runat="server">
<asp:ListItem Value="1">Safe</asp:ListItem>
<asp:ListItem Value="2">Library</asp:ListItem>
<asp:ListItem Value="3">Iron Mountain</asp:ListItem>
<asp:ListItem Value="0">Retire</asp:ListItem>
</asp:DropDownList>
<%# DateTime.Parse(DataBinder.Eval(Container.DataItem,"In Service
Date").ToString()).ToShortDateString() %>

<%# LibraryCount(DataBinder.Eval(Container.DataItem,"TapeID"))%>
</ItemTemplate>

I guess the first question is - am I doing this the best way. Second - if I
am, how do I access loop over each data row in order to pass the TapeID and
the dlTapeStatus.SelectedValue to a method which will insert the data into
the database?
 
G

Guest

I added a Label for each of the DataBinder items so now I can possibly get
the TapeID. Am I on the right track?
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top