1

I want to upload a file on my aspx page.

I am using

<form id="frmId" method="post" enctype="Multipart/form-data">
<input type="file" id="file1"/>
<input type="submit" id="btnsubmit"/>
</form>

and in code behind I am trying to get this file. Its not letting me to get the file until I use server side input file control. I don't want to use runat="server" attribute with my file control.

Do anyone know how to do this.

2
  • Why don't you want to use runat="server" ? Commented Jun 11, 2010 at 12:00
  • It will make my control a server control. Commented Jun 11, 2010 at 12:01

2 Answers 2

1

Have you tried the Request.Files collection?

Sign up to request clarification or add additional context in comments.

Comments

0

You can not access control on server side code with out runat="server" attribute.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.