Greetings,
Problem: I'm unable to determine the Value or Text of a 'clicked' LinkButton located within a DataList.
Is this even possible? How do I even assign the LinkButton a value?
My goal is to: (A.) click on a LinkButton; (B.)display a DropDownList in its place (which works); (C.)Select an option from the DropDownList and (D.) eventually Update a table using the values of both the DropDownList AND LinkButton.
My SQL that populates the DataList is: "SELECT J_ID, J_Name FROM tblTest"
However, in order to UPDATE the table via the OnSelectedIndexChanged event of the DropDownList, I first need to know the Text (J_Name) or Value (J_ID) of the clicked LinkButton.
HELP!!!!
The LinkButton appears to cease being an object once its clicked.
I feel so clueless.....
I greatly appreciate any help you can provide.
Thanks
Problem: I'm unable to determine the Value or Text of a 'clicked' LinkButton located within a DataList.
Is this even possible? How do I even assign the LinkButton a value?
My goal is to: (A.) click on a LinkButton; (B.)display a DropDownList in its place (which works); (C.)Select an option from the DropDownList and (D.) eventually Update a table using the values of both the DropDownList AND LinkButton.
My SQL that populates the DataList is: "SELECT J_ID, J_Name FROM tblTest"
However, in order to UPDATE the table via the OnSelectedIndexChanged event of the DropDownList, I first need to know the Text (J_Name) or Value (J_ID) of the clicked LinkButton.
HELP!!!!
Code:
<asp:DataList ID="dlst_Test" OnItemCommand= "dlstTest_ItemCommand" Runat="Server">
<HeaderTemplate>
<table>
<tr>
<td>Requirement</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:LinkButton Text='<%# Container.DataItem( "J_Name" ) %>' Runat="Server" /></td>
</tr>
</ItemTemplate>
<SelectedItemTemplate>
<tr>
<td><asp:DropDownList id="drpJ_Name" OnSelectedIndexChanged="drpJ_Name_SelectedIndexChanged" AutoPostBack="True" Runat="Server">
</asp:DropDownList></td>
</tr>
</SelectedItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>
The LinkButton appears to cease being an object once its clicked.
I feel so clueless.....
I greatly appreciate any help you can provide.
Thanks