ASP code

Discussion in 'ASP .Net Web Controls' started by Lion, Sep 22, 2006.

  1. Lion

    Lion Guest

    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>
     
    Lion, Sep 22, 2006
    #1
    1. Advertising

  2. Lion

    Lion Guest

    Thanks for your answer Gaurav,

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


    Thanks.
    "Gaurav Vaish (www.EduJiniOnline.com)"
    <> wrote in message
    news:%23BYcEN%...
    >> 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
    > -------------------
    >
    >
     
    Lion, Sep 25, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=

    Fire Code behind code AND Javascript code associated to a Button Click Event

    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=, Feb 10, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    21,340
    =?Utf-8?B?Q2FybG8gTWFyY2hlc29uaQ==?=
    Feb 11, 2004
  2. Craig Kenisston

    HTML code warnings in asp.net html code view

    Craig Kenisston, Oct 7, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,173
    Martin Dechev
    Oct 7, 2004
  3. nick
    Replies:
    3
    Views:
    3,238
    Eliyahu Goldin
    Dec 15, 2004
  4. Peri
    Replies:
    2
    Views:
    2,999
  5. keithb
    Replies:
    1
    Views:
    947
    Bruce Barker
    Mar 29, 2006
Loading...

Share This Page