将单词链接到Google搜索 [英] Link word to google search

查看:65
本文介绍了将单词链接到Google搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.我这里有一个代码,它将在文本框中捕获值并添加一个临时的gridview(未发送到数据库).
我的问题是,当在gridview中添加来自文本框的值时,如何在gridview中将该值作为链接进行链接,以便可以在google中搜索该值.

有想法吗?

Hi.I have a code here where it will capture value from textbox and add in a temporary gridview (not sent to database).
My question is,when a value from textbox is added in the gridview,how to make that value in gridview as a link where it can search the value in google.

Any ideas guys?

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Style="z-index: 106;
    left: 322px; position: absolute; top: 301px">
    <Columns>
    <asp:TemplateField HeaderText="Call Information">
    <ItemTemplate>
    <asp:Label ID="LblName" runat="server" Text='<%#Eval("name")%>'></asp:Label>
    </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField HeaderText="">
    <ItemTemplate>
    <asp:Button ID="BtnDelete" runat="server" Text="Clear" OnClick="BtnDelete_Click" />
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>

推荐答案

您不能只是执行以下操作:

couldn''t you just do something like:

<ItemTemplate>
<a href='http://www.google.com/#q=<%# Eval("name")%>'>
<%#Eval("name")%></a>
</ItemTemplate>



或者您可以将其绑定到超链接控件...



or you could bind it to a hyperlink control...


这篇关于将单词链接到Google搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆