473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Variable vs Page_load

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?

Nov 19 '05 #1
3 1005
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 13 Oct 2005 03:05:27 -0700, "bluewind44" <bl********@gmail.com>
wrote:
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?


Nov 19 '05 #2
Could you show me the example code?
Because I'm really new to ASP.net, it's hard to understand.

Nov 19 '05 #3
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.

--
Scott
http://www.OdeToCode.com/blogs/scott/
On 14 Oct 2005 19:40:02 -0700, "bluewind44" <bl********@gmail.com>
wrote:
Could you show me the example code?
Because I'm really new to ASP.net, it's hard to understand.


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joseph Luner | last post by:
I am having problem postback, (code shown below) the variable "my_str" is lost after clicking the "submit" button. Isn't it suppose to display "changed" after posting back? Is there anyway I...
41
by: Miguel Dias Moura | last post by:
Hello, I am working on an ASP.NET / VB page and I created a variable "query": Sub Page_Load(sender As Object, e As System.EventArgs) Dim query as String = String.Empty ... query =...
1
by: Steve Wark | last post by:
If I create two aspx pages, place three text boxes (working with VS .net 2003 and web form controls) and a button on both forms. On the first page, the button is set to use the "onClick" to open...
0
by: Steve Wark | last post by:
If I create two aspx pages, place three text boxes (working with VS .net 2003 and web form controls) and a button on both forms. On the first page, the button is set to use the "onClick" to open...
9
by: Shapper | last post by:
Hello, I am declaring a variable in my aspx.vb code as follows: Public Class catalogue Public productid As String Private Sub Page_Load ... I have an image button where I call the...
10
by: Mark A. Sam | last post by:
Hello, I am using Visual Web Developer and decared a Public Variable in the Class section. I assigned a value in the load section, and on a button I set it up to increment, but it always...
6
by: Neo Geshel | last post by:
I am trying to deal with an image in code-behind. I consistently get the following error: Server Error in '/' Application. Object variable or With block variable not set. Description: An...
2
by: Jay | last post by:
Is it possible to use the <% %> tag to embed a variable from page_load into a meta tag in the aspx source? Somehow I am not getting the value out of my variable properly - probably not using...
4
by: Arpan | last post by:
The following code works fine: <script runat="server"> Dim strName As String = "Arpan" Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) Page.DataBind() End Sub </script> <form...
10
by: Phillip Vong | last post by:
Newbie learning in VB.NET 2. I'm creating a simple ASP.NET 2 page and I pulling a querystring from a link and I want to use this querystring over and over again through out the page. Example....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.