In my gridview, the first column is a hyperlink field with an account number as the data.
<asp:GridView ID="GridView2" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2" AlternatingRowStyle-BackColor="#CCFFFF"
AllowPaging="True" DataKeyNames="Account_Number">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<Columns>
<asp:HyperLinkField DataTextField="Account_Number" HeaderText="AccountNumber"
NavigateUrl="~/Default2.aspx?myAccount={0}"
SortExpression="Account_Number" />
<asp:BoundField DataField="Full_Name" HeaderText="Full_Name"
SortExpression="Full_Name" />
<asp:BoundField DataField="Last_Name" HeaderText="Last_Name"
SortExpression="Last_Name" />
<asp:BoundField DataField="Social_Number" HeaderText="Social_Number"
SortExpression="Social_Number" />
</Columns>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCFFFF"></AlternatingRowStyle>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStringsurgedAccountsConnectionString %>" >
</asp:SqlDataSource>
When I click on the hyperlink, two things happen that are wrong. Although it does take me to the correct page, that page's load doesn't work. The other problem is that the value that I'm trying to pass, doesn't get passed. I looked at the code behind and this is what I saw...
<td><a href="Default2.aspx?myAccount={0}">9999999999999999</a></td><td>JOE SHERIDAN</td><td>SHERIDAN</td><td>666666666</td>
</tr><tr style="color:#8C4510;background-color:#CCFFFF;">
<td><a href="Default2.aspx?myAccount={0}">8888888888888888</a></td><td>ALICE J SHERIDAN</td><td>SHERIDAN</td><td>777777777</td>
</tr><tr style="color:#8C4510;background-color:#FFF7E7;">
<td><a href="Default2.aspx?myAccount={0}">7777777777777777777</a></td><td>ALVA-GAY SHERIDAN</td><td>SHERIDAN</td><td>888888888</td>
</tr><tr style="color:#8C4510;background-color:#CCFFFF;">
<td><a href="Default2.aspx?myAccount={0}">666666666666666</a></td><td>AMY K SHERIDAN</td><td>SHERIDAN</td><td>999999999</td>
Does anyone have ideas?
<asp:GridView ID="GridView2" runat="server" AllowSorting="True"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2" AlternatingRowStyle-BackColor="#CCFFFF"
AllowPaging="True" DataKeyNames="Account_Number">
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<Columns>
<asp:HyperLinkField DataTextField="Account_Number" HeaderText="AccountNumber"
NavigateUrl="~/Default2.aspx?myAccount={0}"
SortExpression="Account_Number" />
<asp:BoundField DataField="Full_Name" HeaderText="Full_Name"
SortExpression="Full_Name" />
<asp:BoundField DataField="Last_Name" HeaderText="Last_Name"
SortExpression="Last_Name" />
<asp:BoundField DataField="Social_Number" HeaderText="Social_Number"
SortExpression="Social_Number" />
</Columns>
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="#CCFFFF"></AlternatingRowStyle>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStringsurgedAccountsConnectionString %>" >
</asp:SqlDataSource>
When I click on the hyperlink, two things happen that are wrong. Although it does take me to the correct page, that page's load doesn't work. The other problem is that the value that I'm trying to pass, doesn't get passed. I looked at the code behind and this is what I saw...
<td><a href="Default2.aspx?myAccount={0}">9999999999999999</a></td><td>JOE SHERIDAN</td><td>SHERIDAN</td><td>666666666</td>
</tr><tr style="color:#8C4510;background-color:#CCFFFF;">
<td><a href="Default2.aspx?myAccount={0}">8888888888888888</a></td><td>ALICE J SHERIDAN</td><td>SHERIDAN</td><td>777777777</td>
</tr><tr style="color:#8C4510;background-color:#FFF7E7;">
<td><a href="Default2.aspx?myAccount={0}">7777777777777777777</a></td><td>ALVA-GAY SHERIDAN</td><td>SHERIDAN</td><td>888888888</td>
</tr><tr style="color:#8C4510;background-color:#CCFFFF;">
<td><a href="Default2.aspx?myAccount={0}">666666666666666</a></td><td>AMY K SHERIDAN</td><td>SHERIDAN</td><td>999999999</td>
Does anyone have ideas?