Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to programmatically create UpdatePanel with FileUpload?

Reply
Thread Tools

How to programmatically create UpdatePanel with FileUpload?

 
 
Bogdan
Guest
Posts: n/a
 
      08-09-2009
Hi,

I need to programmatically create UpdatePanel with FileUpload control. The
problem is that for FileUpload control to function properly in UpdatePanel
it needs a post back trigger. Unfortunately, according to docs, you cannot
programmatically add triggers to UpdatePanel.
Does that mean that it is impossible to programmatically create UpdatePanels
with FileUpload controls?

Thanks,
Bogdan


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      08-09-2009
a fileupload will not work in an update panel unless it does a full
postback (javascript cannot access a file on the disk). you csn have an
update panel render a fileupload, but you need it to do a form.submit()
from javascript (and be sure the form type is correct) or call the click
event of a button outside the panel.

-- bruce (sqlwork.com)



Bogdan wrote:
> Hi,
>
> I need to programmatically create UpdatePanel with FileUpload control. The
> problem is that for FileUpload control to function properly in UpdatePanel
> it needs a post back trigger. Unfortunately, according to docs, you cannot
> programmatically add triggers to UpdatePanel.
> Does that mean that it is impossible to programmatically create UpdatePanels
> with FileUpload controls?
>
> Thanks,
> Bogdan
>
>

 
Reply With Quote
 
 
 
 
Bogdan
Guest
Posts: n/a
 
      08-10-2009
Bruce,

Thanks for the reply.

If I got it right, the full postback can be achieved by adding a trigger to
an UpdatePanel. Am I right? But, unfortunately, it seems that adding a
trigger to UpdatePanel can only be done declaratively and not
programmatically.

I have a page with one or more small areas dedicated to uploading of files.
Each area initially displays choices and then - based on a choice - either a
file upload control or other controls (listbox, editbox, etc.). It seems
like UpdatePanel would be an ideal choice for the area. I don't think I'd
have a problem with implementing it declaratively. When a FileUpload
control is shown I'd simply assign a postback trigger to Upload button that
I place beside the file upload control. That it turn would result in a full
postback.

But, I can't assign a trigger programmatically. Any ideas?

Thanks again,
Bogdan


"bruce barker" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
>a fileupload will not work in an update panel unless it does a full
>postback (javascript cannot access a file on the disk). you csn have an
>update panel render a fileupload, but you need it to do a form.submit()
>from javascript (and be sure the form type is correct) or call the click
>event of a button outside the panel.
>
> -- bruce (sqlwork.com)
>
>
>
> Bogdan wrote:
>> Hi,
>>
>> I need to programmatically create UpdatePanel with FileUpload control.
>> The problem is that for FileUpload control to function properly in
>> UpdatePanel it needs a post back trigger. Unfortunately, according to
>> docs, you cannot programmatically add triggers to UpdatePanel.
>> Does that mean that it is impossible to programmatically create
>> UpdatePanels with FileUpload controls?
>>
>> Thanks,
>> Bogdan
>>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Triggering an UpdatePanel with a trigger located outside of the UpdatePanel Nathan Sokalski ASP .Net 1 06-15-2009 06:23 PM
Programmatically Set SkinId Properties For Controls Within UpdatePanel? Joey ASP .Net 0 10-24-2007 08:55 PM
How to dynamically create updatepanel around an extended custom control? Risso.D@gmail.com ASP .Net Building Controls 0 09-13-2007 12:51 AM
refresh an updatePanel in an other updatePanel fran_j_diaz@yahoo.fr ASP .Net 3 08-08-2007 06:30 AM



Advertisments