0
我想通过向导插入超链接字段。但是当我运行应用程序时,我用蓝色链接获得文本,但它不可点击。Gridview超链接不工作
这是我的代码:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="stepID" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:HyperLinkField DataNavigateUrlFields="stepID,stepName,stepStartdate,stepEndDate,stageID" DataNavigateUrlFormatString="~/Supervisor/editSteps.aspx?stepID={0}&stepName={1}&Sdate={2}&EDate={3}&stgD={4}" DataTextField="stepName" />
<asp:BoundField DataField="stageID" HeaderText="stageID" SortExpression="stageID" />
<asp:BoundField DataField="stepStartdate" HeaderText="stepStartdate" SortExpression="stepStartdate" />
<asp:BoundField DataField="stepEndDate" HeaderText="stepEndDate" SortExpression="stepEndDate" />
</Columns>
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DefaultConnection %>" SelectCommand="SELECT * FROM [tblsteps] WHERE ([stageID] = @stageID)">
<SelectParameters>
<asp:QueryStringParameter Name="stageID" QueryStringField="StgID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
没有错误或警告,当我运行该应用程序。
[C#中的GridView超链接字段]的可能的复制(http://stackoverflow.com/questions/12823422/gridview-hyperlink-field-in-c-sharp) – MethodMan