HTML Controls w/ .Net

wtbonnell

Freshman
Joined
Oct 6, 2003
Messages
32
I have a basic input tag:
Code:
<input type="file">

How would you read the value within the code behind page (I am using C#, but any lang will do)?

I tried making the input tag a server control:
Code:
<input type="file" runat="server" id="html_Browser">
but that did not seem to help within the code behind page. It is easy for server side contols (such as <asp:Label> because all I would do is just
Code:
lableName.Text
to retrieve the value...any ideas with HTML Controls?!?!

Thanks
 
Give the input an ID...

<input id="txt1" type="file" name="txt1" runat="server">

Then make sure that the code-behind declares it as a System.Web.UI.HtmlControls.HtmlInputFile

HtmlInputFile txt1;
 
Back
Top