1

I am using gridview in my ASP.NET web application and using templatefield to show a column with hyper link. The hyper link is actually a network path (like \\X.X.X.X\SampleFolder).

I want to open the folder when user clicks on the column. Now, the grid shows the expected column with the hyper link applied. But when I click on the column, the path it takes is like file://X.X.X.X/SampleFolder and that's the reason, the shared folder path is not getting opened up. It should be the same as - \\X.X.X.X\SampleFolder.

Any thoughts?

4

1 に答える 1

0

次のTemplateFieldようになります。

<asp:GridView AutoGenerateColumns="false">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <a href='file:///\\X.X.X.X\SampleFolder\<%# DataBinder.Eval(Container.DataItem, "LastName") %> <%# DataBinder.Eval(Container.DataItem, "FirstName") %>'>
                    <%# DataBinder.Eval(Container.DataItem, "LastName") %> <%# DataBinder.Eval(Container.DataItem, "FirstName") %>'>
                </a>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
于 2012-06-28T17:18:41.987 に答える