Home All Groups Group Topic Archive Search About
Author
22 Sep 2006 9:11 AM
Lion
Could someone help me please.

I'm using a file called list.aspx to list the content of directories which
works fine.  What I need its when the files get listed in the IE I would
like to have a two buttons next to the file name  one to SAVE file and the
one to DELETE the file.

Thanks for your help.

This is the code in the file.

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>New Page 1</title>
</head>

<body>Please read the disclaimer at the bottom of this e-mail



<p><b><font face="Tahoma" color="#66CCFF" size="4">C drive
Stuff</font></b></p>

<%@ Import Namespace="System.IO" %>
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
   Dim dirInfo as New DirectoryInfo(Server.MapPath(""))

   articleList.DataSource = dirInfo.GetFiles("*.pdf")
   articleList.DataBind()
End Sub
</script>

<asp:DataGrid runat="server" id="articleList" Font-Name="Tahoma"
   AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#eeeeee"
   HeaderStyle-BackColor="#66ccff" HeaderStyle-ForeColor="White"
   HeaderStyle-Font-Size="10pt" HeaderStyle-Font-Bold="True">
<Columns>
   <asp:HyperLinkColumn DataNavigateUrlField="Name"
DataTextField="Name"
          HeaderText="File Name"      />

       <asp:BoundColumn DataField="LastWriteTime"     HeaderText=
"Last Write Date"
       ItemStyle-HorizontalAlign="Center  " DataFormatString="{0:d}" />

       <asp:BoundColumn DataField="LastWriteTime"     HeaderText=
"Last Write Time"
       ItemStyle-HorizontalAlign="Center  " DataFormatString="{0:t}" />

       <asp:BoundColumn DataField="Length" HeaderText="File Size"
               ItemStyle-HorizontalAlign="Right"
               DataFormatString="{0:#,### bytes}" />
</Columns>
</asp:DataGrid>

Author
24 Sep 2006 2:10 PM
Gaurav Vaish (www.EduJiniOnline.com)
> I'm using a file called list.aspx to list the content of directories which
> works fine.  What I need its when the files get listed in the IE I would
> like to have a two buttons next to the file name  one to SAVE file and the
> one to DELETE the file.

Add a TemplateColumn to the list of Columns.


Author
25 Sep 2006 10:03 AM
Lion
Thanks for your answer Gaurav,

I really don't know what you mean could you explain please.


Thanks.
"Gaurav Vaish (www.EduJiniOnline.com)"
<gaurav.vaish.nospam@nospam.gmail.com> wrote in message
Show quoteHide quote
news:%23BYcEN%233GHA.508@TK2MSFTNGP06.phx.gbl...
>> I'm using a file called list.aspx to list the content of directories
>> which works fine.  What I need its when the files get listed in the IE I
>> would like to have a two buttons next to the file name  one to SAVE file
>> and the one to DELETE the file.
>
> Add a TemplateColumn to the list of Columns.
>
>
> --
> Happy Hacking,
> Gaurav Vaish | http://www.mastergaurav.com
> http://www.edujinionline.com
> http://articles.edujinionline.com/webservices
> -------------------
>
>
Author
26 Sep 2006 6:05 PM
Gaurav Vaish (www.EduJiniOnline.com)
> I really don't know what you mean could you explain please.

<Columns>
<TemplateColumn>
    <asp:Button id='saveButton' runat='server' onClick='saveButton_Click'
Text='Save' />
    <asp:Button id='deleteButton' runat='server'
onClick='deleteButton_Click' Text='Delete' />
</TemplateColumn>
</Columns>

In the codebehind, add two methods -- saveButton_Click and
deleteButton_Click.