saving displayed text in textbox
-
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
-
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
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.
-
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
-
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
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