I have a treeview control that gets information from a database. I have everything working when it's in the page_load event. However, when I set the primary key to gridview.selecteddatakey(0), I get the null error. I tried doing an IF gridview.selecteddatakey(0) is vbnullstring then exit sub, but it still doesnt like the gridview.selecteddatakey(0). Anyway, so, I want the treeview to populate upon the select button. I'll his the select button on the gridview and then have it populate. I renamed the subroutine to tree1 and added OnClick="tree1" to the selected button. Now, when I run the page, I get:
Compilation Error
Description:
An error occurred during the compilation of a resource required to service
this request. Please review the following specific error details and modify your
source code appropriately.
Compiler Error Message: BC30408:
Method 'Private Sub tree1(sender As Object, e As
System.Web.UI.WebControls.TreeNodeEventArgs, a As System.EventArgs)' does not
have the same signature as delegate 'Delegate Sub EventHandler(sender As Object,
e As System.EventArgs)'.
Source Error:
|
Line 190: SelectCommand="SELECT * FROM [Invoices]"></asp:SqlDataSource> Line 191: <br /> Line 192: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="tree1" /><br /> Line 193: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2" DataKeyNames="PrimaryKey"> Line 194: <Columns> |
I dont know what this means. I tried putting delegate in front but then i got more errors.