Variable vs Page_load

  • Thread starter Thread starter bluewind44
  • Start date Start date
B

bluewind44

Hello,
Now, I'm making the multi-upload module.

I declared the array of HttpPostedFile and
When I choose the file by System.Web.UI.HtmlControls.HtmlInputFile
I set the System.Web.UI.HtmlControls.HtmlInputFile's HttpPostedFile
reference to the declared array.

I did it, because I wanna Send Files to Webservice all together.

BUT, after the button event the array of HttpPostedFile resets.

How do I solve this problem?

Is there anyone who can help me out?
 
You'll have to recreate the array on postback. The controls you
referenced and the array that existed when the page originally loaded
are dumped after the page finishes that one request.
 
Could you show me the example code?
Because I'm really new to ASP.net, it's hard to understand.
 
Well, I think the best approach would be to show us your code. It
sounds as if you already have the basics working, you probably just
need to arrange for some of your code to run on the initial page load
and also on a postback. I'm sure you are pretty close to a solution.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top