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

Upload, SSL and more php help
I recently just installed a ssl cert and do i use https for the whole site or just for the checkout.

How would I convert this into code using an if statement?
ES equals exam score m equals $mean s equals $total. I already coded my mean and total so I'm not g

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

How to write on database when a link is clicked?
Hi, I have a list of products in a gridview. When the link is clicked currently it takes to an ext

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

Multi image upload
I have a gallery to build and want to build a dynamic upload form to allow for $var number of fields

single page with referrer to show correct page
I have a simple website with a couple of different pages. I would like to be able to in a div tag w

Login Control?!
I have a Web Site that uses the login control also I have set the destinationurl to the page I want

Timer control causing error
I recently decided to add a timer control to an existing page that uses AJAX on my site. As soon as

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