troubleshooting Question

gridview on default1.aspx has a hyperlink field to default2.aspx using url passing parameters

Avatar of cedent
cedentFlag for United States of America asked on
JavaScriptNetworkingMicrosoft Development
1 Comment1 Solution748 ViewsLast Modified:
, default2.aspx opens but the gridview doesn't appear because it doesn't seem to receive the parameters. Using vb.net code. If I use default values in the sqlcontrol it will appear using those. What am I missing? Do I need to do something else on the default2 page to make it recognize the parameters coming via the querystring?
Default1.aspx has a gridview that uses this code:
                  <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                        AutoGenerateColumns="False" DataSourceID="SqlDataSource1" CellPadding="4" 
                        ForeColor="#333333" GridLines="None">
                        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                        <Columns>
                            <asp:HyperLinkField DataTextField="Query Count" HeaderText="Query Count" 
                                SortExpression="Query Count" 
                                DataNavigateUrlFields="lev3head,workcity,workstate,company" 
                                DataNavigateUrlFormatString="~/Default2.aspx?lev3head={0},workcity={1},workstate={2},company={3}&quot;          ">
                            <ControlStyle ForeColor="#FF3300" />
                            </asp:HyperLinkField>
                            <asp:BoundField DataField="Lev3Head" HeaderText="Lev3Head" 
                                SortExpression="Lev3Head" />
                            <asp:BoundField DataField="WorkCity" HeaderText="WorkCity" 
                                SortExpression="WorkCity" />
                            <asp:BoundField DataField="WorkState" HeaderText="WorkState" 
                                SortExpression="WorkState" />
                            <asp:BoundField DataField="Company" HeaderText="Company" 
                                SortExpression="Company" />
                            <asp:BoundField DataField="CompanyDesc" HeaderText="CompanyDesc" 
                                SortExpression="CompanyDesc" />
                        </Columns>
                        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#999999" />
                        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
 
default2.aspx has a grid view that uses this:
                    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                        AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                            <asp:BoundField DataField="ManLevel" HeaderText="ManLevel" 
                                SortExpression="ManLevel" />
                            <asp:BoundField DataField="JobCodeDesc" HeaderText="JobCodeDesc" 
                                SortExpression="JobCodeDesc" />
                            <asp:BoundField DataField="WorkAddress" HeaderText="WorkAddress" 
                                SortExpression="WorkAddress" />
                        </Columns>
                    </asp:GridView>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:NewForce %>" 
        SelectCommand="SELECT Name, ManLevel, JobCodeDesc, WorkAddress FROM FOMonthlyDataAllVZ WHERE (Lev3Head = @lev3head) AND (WorkCity = @workcity) AND (WorkState = @workstate) AND (Company = @company) ORDER BY WorkAddress, Name">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="" Name="lev3head" QueryStringField="lev3head" />
            <asp:QueryStringParameter DefaultValue="" Name="workcity" QueryStringField="workcity" />
            <asp:QueryStringParameter DefaultValue="" Name="workstate" 
                QueryStringField="workstate" />
            <asp:QueryStringParameter DefaultValue="" Name="company" 
                QueryStringField="company" />
        </SelectParameters>
    </asp:SqlDataSource>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros