Ajax File Uploader

A

Author #1

My asp.net 3.5 web application needs to upload many user documents to
the SQL Server database. I don't quite like the asp.net native
FileUpload control, so I searched a little on the web and found one at

http://en.fileuploadajax.subgurim.net/

It is pretty good in that it is free and works like the gmail
attachment uploader.

The only problem I have with this control is this:

If I pass some variables and their values from Page1.aspx through the
query string to Page2.aspx which uses this control, I won't be able to
retrieve these variables from the query string. I also tried passing
these variables through the Context collection, it still doesn't
work. It'll work if I pass these values through session or if I store
them in the SQL Server database and retrieve them in Page2.aspx.

Somehow the query string or the Context collection isn't available to
the iframe of the this file upload control, thus when the file upload
causes a postback, I receive an exception.

I don't quite like the session or db solution to this problem, because
the session variable will be available to all pages while the session
is valid. And for the db solution, I will have to clean up the stored
variables in the db when the session times out or when a user logs
out. A lot of trouble.

Any suggestion for a good ajax file uploader? Thanks.
 
P

Patrice

Hello,
If I pass some variables and their values from Page1.aspx through the
query string to Page2.aspx which uses this control, I won't be able to
retrieve these variables from the query string.
Somehow the query string or the Context collection isn't available to
the iframe of the this file upload control, thus when the file upload
causes a postback, I receive an exception.

An iframe is just a kind of browser side "placeholder" that shows the
content of a page inside a page. My guess is that you pass those values as a
querystring to the page that contains the iframe tag but not to the url used
by the iframe tag itself. It shoudl work if you do so...
 
A

Author #1

Hello,


An iframe is just a kind of browser side "placeholder" that shows the
content of a page inside a page. My guess is that you pass those values as a
querystring to the page that contains the iframe tag but not to the url used
by the iframe tag itself. It shoudl work if you do so...

Thanks for the hint. If there is a iframe, it is built into the ajax
file upload control, I have no idea how it works and what URL it may
get.
 
P

Patrice

Thanks for the hint. If there is a iframe, it is built into the ajax
I gave a quick look and it seems to create and use programmatically an
iframe. The first question would be where/how do you try to read the
querystring ? If this is in the usual page2.aspx lifecycle it should work as
you likely passed correctly the values. If this is in an AJAX related call
it is likely that the control doesn't pass those automatically and it would
explain why you can't read them. You could start by checking the request to
first see if the needed values are passed or not (whihc is likely) on the
querystring. Then you'll have to fix the problem (whihc may be more or less
complex especially if the source is not provided).

Good luck.
 
A

Author #1

I gave a quick look and it seems to create and use programmatically an
iframe. The first question would be where/how do you try to read the
querystring ? If this is in the usual page2.aspx lifecycle it should work as
you likely passed correctly the values. If this is in an AJAX related call
it is likely that the control doesn't pass those automatically and it would
explain why you can't read them. You could start by checking the request to
first see if the needed values are passed or not (whihc is likely) on the
querystring. Then you'll have to fix the problem (whihc may be more or less
complex especially if the source is not provided).

Good luck.

The control has to be wrapped up in an UpdatePanel. I have no problem
working with the query string parameters if I simply remove this
control from the web form. This control will cause a double postback.
The first time, the web form does a postback, then (I guess) the
iframe of this control causes a postback. During the first postback,
I can retrieve the query string parameters and their values, but
cannot in the second postback. I notice this when I was using the
debugger.
 
P

Patrice

At this step you should likely provide the shortest possible sample that
shows this problem all along with the overall goal (you won't to puload a
file without refreshing the whole page ?) so that we can better understanbd,
repro the problem and possibly solve it.

For now I would say that you are confusing plain regular postback and out of
band AJAX based postback who likely won't provide the querystring
information ? Also the goal of this third party control seems to avoid a
refresh so I'm not sure why you have to put this in an update panel.

Sorry for the poor help.
 
A

Author #1

At this step you should likely provide the shortest possible sample that
shows this problem all along with the overall goal (you won't to puload a
file without refreshing the whole page ?) so that we can better understanbd,
repro the problem and possibly solve it.

For now I would say that you are confusing plain regular postback and out of
band AJAX based postback who likely won't provide the querystring
information ? Also the goal of this third party control seems to avoid a
refresh so I'm not sure why you have to put this in an update panel.

Sorry for the poor help.

Hi, thank you for the hint. I create a small website to test this
control, and it doesn't have problem with my query string variables.
I guess it is something else on my web form that's causing this
problem. I will do some further analysis and see what exactly is
going on.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top