I have a DataGrid named as dgVideo with two columns:
a BoundColumn DataField="ID"
a template column which has
<%# Container.DataItem("DATA_FILE")%>"
<%# Container.DataItem("DATA_SOURCE")%>"
<asp:Button id="Button1" runat="server" Text="Add to Favorite" OnClick="Button1_Click" ></asp:Button>
I want to insert the BoundColumn("ID") data into a table called 'Favorites' on this button click event.
I Use 'dgVideo.SelectedItem.Cells(0).Text' to retrive the data. But I got error that "Object reference not set to an instance of Object'
Can anyone help me fix this?
a BoundColumn DataField="ID"
a template column which has
<%# Container.DataItem("DATA_FILE")%>"
<%# Container.DataItem("DATA_SOURCE")%>"
<asp:Button id="Button1" runat="server" Text="Add to Favorite" OnClick="Button1_Click" ></asp:Button>
I want to insert the BoundColumn("ID") data into a table called 'Favorites' on this button click event.
I Use 'dgVideo.SelectedItem.Cells(0).Text' to retrive the data. But I got error that "Object reference not set to an instance of Object'
Can anyone help me fix this?