Add trigger to UpdatePanel programmatically


Posted on 16th Feb 2014 07:03 pm by admin

Hi,I'm working on a website which uses AJAX and Masterpages. What I have is an AJAX UpdatePanel which contains the ContentPlaceHolder on the MasterPage.However, on one page I have a FileUpload control, which means I have to add the Submit button as a Postback trigger to the UpdatePanel, otherwise the file upload will not work. I've tried doing this both from the MasterPage code file and the Page code file itself without any luck...The code from my masterpage attempt: If Page.Request.RawUrl.Contains("UploadPage.aspx") Then
Dim trigger As UpdatePanelControlTrigger = New PostBackTrigger()
Dim s As Button = page.FindControl("submitBut")
trigger.ControlID = s.ID
up.Triggers.Add(trigger)
End IfWhere up is the id for the update panel.I get an error message saying: A control with ID 'submitBut' could not be found for the trigger in UpdatePanel 'up'.Any help would be greatly appreciated.Thanks in advance
Filed under: updatepanel add trigger programmatically

No comments posted yet

Your Answer:

Login to answer
345 Like 16 Dislike
Previous forums Next forums
Other forums

PHP search multiple input field box help
I am having a problem with my search script. At current it will simply search by a selected date whi

Beginner question regarding Array's
Hi everyone, the page im working on has an array of variable at the top...

Code: $define_li

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

Collecting AOL Search Terms
I am attempting to collect AOL search terms. I know the code is correct (it works for google, bing,

Loop column after 2 results
Hello All.

Here is what I have:

Client ID Company name Clien

Delete all from a table
I can not get the following code to work. If I run the sql statement in the db it will delete all t

recrawling
Can anyone suggest me how may i know a page is updated before it is being downloaded, so that i can

Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon

Why use interfaces in PHP (OOP)
I am learning OOP in PHP and its been a pretty good learning experience so far. What I didn't unders

admin with my register system?
Hey i wana make it so i can make a admin level on my register system , I'm kinda new to php to im no

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash