Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. saving displayed text in textbox

saving displayed text in textbox

Scheduled Pinned Locked Moved ASP.NET
htmlcomsysadminquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jon G
    wrote on last edited by
    #1

    I have a textbox control, which is a HTML control, set to run on server side. I made it of type=File so that the user may browse and select the file they wish to use. Code: I have two questions (1) - How would I make it so that the text in that textbox is saved between posts? (2) - Is there a way to tell the control what file types to display (restrict the file types displayed) when browsing? I just want it to display Jpg/Gif/Bmp TIA Jon G www.Gizmocoder.com

    M V 2 Replies Last reply
    0
    • J Jon G

      I have a textbox control, which is a HTML control, set to run on server side. I made it of type=File so that the user may browse and select the file they wish to use. Code: I have two questions (1) - How would I make it so that the text in that textbox is saved between posts? (2) - Is there a way to tell the control what file types to display (restrict the file types displayed) when browsing? I just want it to display Jpg/Gif/Bmp TIA Jon G www.Gizmocoder.com

      M Offline
      M Offline
      Mike Ellison
      wrote on last edited by
      #2

      Hi Jon. (1) - I think the <input type="file"> tag's value attribute is read-only; I don't believe you can set it (e.g. between posts) (2) - Try setting the accept attribute on the <input> tag to the allowed MIME types -- something like:

      <input id="File1" type="file"
      accept="image/*" runat="server"/>

      I don't know how the support is for this attribute among the browsers, but it's the closest thing I can see to your question.

      1 Reply Last reply
      0
      • J Jon G

        I have a textbox control, which is a HTML control, set to run on server side. I made it of type=File so that the user may browse and select the file they wish to use. Code: I have two questions (1) - How would I make it so that the text in that textbox is saved between posts? (2) - Is there a way to tell the control what file types to display (restrict the file types displayed) when browsing? I just want it to display Jpg/Gif/Bmp TIA Jon G www.Gizmocoder.com

        V Offline
        V Offline
        V 0
        wrote on last edited by
        #3

        save the textbox contents in a session object or chache object. then set the value back in on Page_Load. hope this helps. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

        J 1 Reply Last reply
        0
        • V V 0

          save the textbox contents in a session object or chache object. then set the value back in on Page_Load. hope this helps. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

          J Offline
          J Offline
          Jon G
          wrote on last edited by
          #4

          The main problem here is that you cannot set the text inside the control (its read-only). I was hop8ing to find a work around to this problem. Thanks for your help. Jon G www.Gizmocoder.com

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups