Can anyone tell me what I need to do to get a select button to pass an id number to a formview page?
Here is my code:
gridview:
<asp:GridView ID="gdStreet" runat="server" DataSourceID="odbPIResults" onselectedindexchanged="gdStreet_SelectedIndexChan ged"
DataKeyNames="Tax_ID"
AutoGenerateColumns="False"
SelectedIndex="0">
<Columns>
<asp:CommandField
ButtonType="Button"
ShowSelectButton="True"
CausesValidation="False"
>
</asp:CommandField>
(I have also tried to use the buttonfield with this code:
<asp:ButtonField ButtonType="Button"
CommandName="Select"
Text="Details" >
</asp:ButtonField>
instead of the commandfield.)
formview:
Protected Sub gdStreet_SelectedIndexChanged(ByVal sender As _
Object, ByVal e As System.EventArgs) Handles _
gdStreet.SelectedIndexChanged
Dim strID As String = gdStreet.SelectedRow.Cells(1).Text
End Sub
The strID field is empty when I run the code. What am I missing here?
Thanks for your help!
:)