Professional Web Applications Themes

How to add "..." button to a property to open up "File Open"? - ASP.NET Building Controls

I am creating a control and thinking about adding a property to the control. I will like a "..." button shown next to the value of this property when user clicks on this property. I want to open up standard "File Open" dialog box when the user then clicks on "..." button. Any suggestion or sample code?...

  1. #1

    Default How to add "..." button to a property to open up "File Open"?

    I am creating a control and thinking about adding a property to the control.
    I will like a "..." button shown next to the value of this property when user
    clicks on this property. I want to open up standard "File Open" dialog box
    when the user then clicks on "..." button. Any suggestion or sample code?
    slow learner Guest

  2. #2

    Default Re: How to add "..." button to a property to open up "File Open"?

    That is something I tried to figure out for a while also, but once you see
    an example it is actually quite simple. Here is an example I used I created,
    along with the website that taught me how to do it:

    Private Sub btnDownload_Click(ByVal sender As System.Object, ByVal e As
    System.EventArgs) Handles btnDownload.Click
    Response.ClearContent()
    Response.ContentType = "text/plain"
    Response.AddHeader("content-disposition",
    "attachment;filename=download.txt")
    'Response.WriteFile(Server.MapPath("download.txt") )
    Response.Write("This is a test download text file" &
    ControlChars.NewLine)
    Response.Write(Date.Now.ToLongDateString() & " " &
    Date.Now.ToLongTimeString())
    Response.End()
    End Sub

    My example asks the user to download a text file that contains the string
    "This is a test download text file" followed by the date & time (note the
    two Response.Write lines). If you want to give the user a file instead, set
    the Response.ContentType to the appropriate string and use
    Response.WriteFile instead (I have this line commented out, you will have to
    uncomment it). You can also, if you want, use a combination of WriteFile and
    Write when sending a text file. For more details, see the following site
    which is where I learned how to do this:

    [url]http://www.dotnetspider.com/technology/kbpages/553.aspx[/url]

    Good Luck!
    --
    Nathan Sokalski
    [email]njsokalskihotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]

    "slow learner" <slowlearnerdiscussions.microsoft.com> wrote in message
    news:C6F64371-3DDD-4DBA-B774-25901FD32708microsoft.com...
    >I am creating a control and thinking about adding a property to the
    >control.
    > I will like a "..." button shown next to the value of this property when
    > user
    > clicks on this property. I want to open up standard "File Open" dialog box
    > when the user then clicks on "..." button. Any suggestion or sample code?

    Nathan Sokalski Guest

  3. #3

    Default Re: How to add "..." button to a property to open up "File Open"?

    You'll probably want to use the Editor Attribute, as demonstrated in this
    code sample:
    [url]http://SteveOrr.net/articles/InheritAndExtend.aspx[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    [url]http://SteveOrr.net[/url]





    "slow learner" <slowlearnerdiscussions.microsoft.com> wrote in message
    news:C6F64371-3DDD-4DBA-B774-25901FD32708microsoft.com...
    >I am creating a control and thinking about adding a property to the
    >control.
    > I will like a "..." button shown next to the value of this property when
    > user
    > clicks on this property. I want to open up standard "File Open" dialog box
    > when the user then clicks on "..." button. Any suggestion or sample code?

    Steve C. Orr [MVP, MCSD] Guest

Similar Threads

  1. changing the default folder for the "open file" command
    By amiperl@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 26th, 05:16 PM
  2. animation "open" onPress( animation "close" ) go to Frame "myFrame"
    By CheyenneWay webforumsuser@macromedia.com in forum Adobe Flash, Flex & Director
    Replies: 0
    Last Post: January 4th, 09:12 PM
  3. Replies: 0
    Last Post: September 22nd, 03:31 AM
  4. Unable To Open File "..." Because It Is Already Open With Write Permission
    By PixelaseR webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 1
    Last Post: August 18th, 06:33 PM
  5. Button to launch the "File Open" dialog
    By Eric Newton in forum ASP.NET Security
    Replies: 0
    Last Post: August 15th, 06:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139