日期:2014-05-18  浏览次数:20834 次

怎样在gridview中把相就的列设置为超级链接?
从数据库中读出的网址,放到gridview里面只显示为一般的字符,不是超级链接,
<asp:GridView   ID= "GridView1 "   runat= "server "
                        DataKeyNames= "id "   DataSourceID= "ObjectDataSource1 "   >                      
                       
                </asp:GridView>
               
                <asp:ObjectDataSource   ID= "ObjectDataSource1 "   runat= "server "   DeleteMethod= "delete "
                        SelectMethod= "tdataset "   TypeName= "datasource "   UpdateMethod= "sqlup ">
                        <DeleteParameters>
                                <asp:Parameter   Name= "id "   Type= "Int32 "   />
                                <asp:Parameter   Name= "webht "   Type= "String "   />
                                <asp:Parameter   Name= "city "   Type= "String "   />
                        </DeleteParameters>
                        <UpdateParameters>
                                <asp:Parameter   Name= "id "   Type= "Int32 "   />
                                <asp:Parameter   Name= "webht "   Type= "String "   />
                                <asp:Parameter   Name= "city "   Type= "String "   />
                        </UpdateParameters>
                        <SelectParameters>
                                <asp:Parameter   DefaultValue= "select   *   from   webtab "   Name= "querystring "   Type= "String "   />
                        </SelectParameters>
                </asp:ObjectDataSource>

------解决方案--------------------
<columns>
<ItemTemplate>
<a href= ' <%# Eval( "网址字段 ")%> '> x </a>
</ItemTemplate> <