Asp 当点击 link 时,GridView 将本地主机放在前面

Asp GridView prepended localhost when clicking on the link

我正在使用 asp:GridView。我有一个带有 hyperlink 的字段。当我单击 link 时,我必须能够更新 link(通过单击 'edit')并连接 link 提供的网站。一切正常,除了当我点击 link 时,我已经预先设置了 localhost。因此,如果我的 link 是:www.google.com,单击 link,我将被重定向到 localhost:8080/www.google.com。如何摆脱前置的本地主机?

我的代码如下:

<asp:BoundField 
DataField="CUSTOMER"
HtmlEncode="False"  
DataFormatString="<a target='_blank' href='{0}'>{0}</a>"
HeaderText="Customer - link" />

试试这个,这对你有用

    <Columns>
        <asp:BoundField
            DataField="CUSTOMER"
            HtmlEncode="False"
            DataFormatString="<a target='_blank' href='https://{0}'>{0}</a>"
            HeaderText="Customer - link" />
    </Columns>