Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a basic input tag:

<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:

<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

lableName.Text 

to retrieve the value...any ideas with HTML Controls?!?!

 

Thanks

  • Moderators
Posted

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;

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...