An example of the OLD/current site is here: http://www.mentalhea...l?therapistId=4
Instead of using IFrames and server-side includes withing those IFrames, I am developing the functionality using a combination of ASP.NET controls.
If you look at the page associated with the above link, the object of my confusion is the PREFERENCES area on the right-side of the page. Currently the website allows visitors to click the green plus signs to add an item to the Preferences area. Once the item is placed in the Preferences area, a visitor can remove them by clicking a red x next to the item.
I am attempting to imitate this functionality using LINKBUTTONS within a DATALIST - and, frankly, I am uncertain how to do this.
The information from the DataList is dependent on a DetailsView control placed at the top of the page - both work very well. I'm just stuck how to get the LinkButton within the DataList to pass the value of the DataList item.
I should note that I'm only assuming this will be tied to a LABEL control, which I have on the page named "lblText", it's just not in the source provided below.
Here is the code for the DataList control:
<asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSourceOffice" DataKeyField="officeID"> <ItemTemplate> OfficeName: <asp:Label ID="OfficeNameLabel" runat="server" Text='<%# Eval("OfficeName") %>' /> <br /> <asp:LinkButton ID="LinkButton1" runat="server" CommandName="Select" CommandArgument='<%# Eval("OfficeName") %>' onclick="LinkButton1_Click" >LinkButton</asp:LinkButton> <br /> <br /> </ItemTemplate> </asp:DataList>
Here is the code behind - clearly NOT even close. I'm just not sure how to proceed.
Protected Sub LinkButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) lblText.Text = DataList1.SelectedValue.ToString End Sub End Class
Thank you for any assistance you might be able to provide.