Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I make some directories in a web project, as follow: <strong>Documents/WhitePaper/Resources/PDF</strong> and put some documents there, <strong>Word.doc, Excel.xls, PowerPoint.ppt</strong>. now in grid view:</p> <pre><code>&lt;asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" Width="99%"&gt; &lt;FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /&gt; &lt;RowStyle BackColor="#E3EAEB" /&gt; &lt;Columns&gt; &lt;asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Title"&gt; &lt;ItemStyle HorizontalAlign="Center" Wrap="False" Width="100px" /&gt; &lt;/asp:BoundField&gt; &lt;asp:HyperLinkField DataNavigateUrlFields="Url" DataNavigateUrlFormatString="{0}" DataTextField="Category" HeaderText="Category" /&gt; &lt;/Columns&gt; &lt;PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /&gt; &lt;SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" /&gt; &lt;HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" /&gt; &lt;EditRowStyle BackColor="#7C6F57" /&gt; &lt;AlternatingRowStyle BackColor="White" /&gt; &lt;/asp:GridView&gt; &lt;asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="&lt;%$ ConnectionStrings:ConnectionString %&gt;" SelectCommand="SELECT * FROM [UsefulResources]"&gt;&lt;/asp:SqlDataSource&gt; </code></pre> <p>the link in this grid view points to each files and on click, starts download target file. Url field in database is like this: <strong><em>~/Documents/WhitePaper/Resources/PDF/test.pdf</em></strong></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload