GridView中的超链接 [英] Hyper link in gridview

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

问题描述

你好

我有一个子域,我想通过gridview中的超链接从该子域检索到主域的文件,并将该文件的路径存储在数据库中.为此,我使用以下代码:



Hello

I have a subdomain, and i want to retrieve a file from that subdomain to main domain by hyperlink in gridview and i store path of that file in database. For that i use following code:



<Columns>
            <asp:BoundField DataField="id" HeaderText="S No" ReadOnly="True"  SortExpression="id" Visible="false" />
                <asp:TemplateField SortExpression="">
                    <ItemTemplate>
                         <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("pathname") %>'><%# Eval("remark")%></asp:HyperLink>
                       </ItemTemplate>
                </asp:TemplateField>
            </Columns>




在这里pathname中存储的文件路径仅不包括子域地址,所以我该怎么办.
我尝试了很多方法,但我没有怀疑,请plz尽快帮助我
谢谢




here in pathname store the path of file only not including subdomain address so how could i do it.
I try lots of way but i am not sussess so plz help me soon
Thanks

推荐答案

引用此链接,可能有帮助

http: //weblogs.asp.net/fmarguerie/archive/2004/05/05/avoiding-problems-with-relative-and-absolute-urls-in-asp-net.aspx [
Refer this link, might help

http://weblogs.asp.net/fmarguerie/archive/2004/05/05/avoiding-problems-with-relative-and-absolute-urls-in-asp-net.aspx[^]


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

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