DataBinding HTML Controls

shahab

Junior Contributor
Joined
Aug 14, 2003
Messages
206
Location
Iran(Middle East)
How can I bind the HTML Controls to Ms sql server tables?
I have stored the name of uploaded files in a database column called File name.(So I want to bind a name in HtmlInputFile)
protected System.Web.UI.HtmlControls.HtmlInputFile File1; :-\ :p
Now how can i read the value of Filename to File1?
(DataReader or fill or Eval.DataBinder?) :confused:
 
I've tried something like this before, but didn't work. What I did was place the filename in a label above the HtmlInputFile control.....
 
Any way, I don't think its right to bind a HtmlFileInput control. The text thats dispayed in this control is the path of a filename in the user's machine, so lets say you bind it to a field in a database table, what will be displayed in it will be the filename only. There are two major problems in this
1. There is no path information
2. Even if there is a path with the filename, what if the user doesn't have a file with this name on his computer.

So I don't think its a good idea to bind a HtmlFileInput control.
 
Back
Top