?
Solved

I want to use a Trigger event for an Update Panel that is being bound by a repeater, error: The ControlID property must be set on the trigger in UpdatePanel

Posted on 2008-11-03
10
Medium Priority
?
1,207 Views
Last Modified: 2012-05-05
I have a Repeater that I am creating on Page_Load() that is creating a bunch of ImageButtons that have a OnClick function.  When they click the Image I want it to update a panel to perform the OnClick function of the ImageButton.    What is happening though is I am getting a: The ControlID property must be set on the trigger in UpdatePanel.   Any help would be appreciated.  Thanks
0
Comment
Question by:higginsonline
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
10 Comments
 
LVL 18

Expert Comment

by:David Robitaille
ID: 22867069
i got dificulty to understant what you mean, but here my advice.
dont put any trigger on the update panel, keep it conditional = true (a chlidrenastrigger false)
on the OnClick function, use the updatepanel.update() function to "trigger" the update
0
 

Author Comment

by:higginsonline
ID: 22867219
Okay so far my updatePanel I now have:

 <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server" ChildrenAsTriggers="false">
        <ContentTemplate>
       
        </ContentTemplate>
    </asp:UpdatePanel>

And for my code behind I have:
    Public Sub setClick()
        test.Text = "yup"
        UpdatePanel1.Update()
    End Sub

Is this what you mean?
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 22867239
yes
but "test" label or textbox should be inside your ContentTemplate...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:higginsonline
ID: 22867287
Oops, yes indeed it should.   I am getting this error when I run it and click on the Link...

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

I do not want to turn Off my Event Validation though for this to work.... any suggestions?
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 22867345
well, it<s because you "created" the images buttons in the Page_Load.
  1. test, if you remove the avlidation, just to make sure it works without it, then pput it back
  2. check if you could "build" your repeater an other way. if your reapeter is declared on the aspx page and is only "binded" on page load, it should work.
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 22867356
avlidation = EventValidation
0
 

Author Comment

by:higginsonline
ID: 22867364
You were correct again I just put a If Not IsPostBack around the repeater.... and it works to some extent.

The OnClick function is refreshing the the whole page and not just my UpdatePanel section..
0
 
LVL 18

Accepted Solution

by:
David Robitaille earned 2000 total points
ID: 22867553
well, i suse the update in a different contex, the image button trigger a postback...
I just made test and  you could trigger a AsyncPostBackTrigger for the whole repeater with this Trigger : (i think you dont need to use update function with that, but i<m not that sure)
<Triggers>
<asp:AsyncPostBackTrigger ControlID="repeaterName" />
</Triggers>
0
 

Author Comment

by:higginsonline
ID: 22867572
That worked perfectly.. Thank you for allllll your help :)
0
 
LVL 18

Expert Comment

by:David Robitaille
ID: 22867603
it was a pleasure, thanks for the grade, and next time add Ajax in your Zones.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question