C
Chris
I have two SQLDataControls on a page. The first pulls all the data from a
table and is then bound to a gridview. The second uses the selected value in
the gridview which is in turn bound to a formview. When I run the page no
binding takes place, I assume that's because I haven't selected the
gridview. When I select a link it does nothing. What am I doing wrong?
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:CodeTrackerConnectionString %>"
SelectCommand="SELECT [PageID], [Title], [Description], [Keywords],
FROM [tblPages]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:CodeTrackerConnectionString %>"
SelectCommand="SELECT [Title], [Description], [Keywords], [URL], [PageID]
FROM [tblPages] WHERE ([PageID] = @PageID)"<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="PageID"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
table and is then bound to a gridview. The second uses the selected value in
the gridview which is in turn bound to a formview. When I run the page no
binding takes place, I assume that's because I haven't selected the
gridview. When I select a link it does nothing. What am I doing wrong?
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$
ConnectionStrings:CodeTrackerConnectionString %>"
SelectCommand="SELECT [PageID], [Title], [Description], [Keywords],
FROM [tblPages]">
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:CodeTrackerConnectionString %>"
SelectCommand="SELECT [Title], [Description], [Keywords], [URL], [PageID]
FROM [tblPages] WHERE ([PageID] = @PageID)"<SelectParameters>
<asp:ControlParameter ControlID="GridView1" Name="PageID"
PropertyName="SelectedValue"
Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>