higginsonline
asked on
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
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
ASKER
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?
<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?
yes
but "test" label or textbox should be inside your ContentTemplate...
but "test" label or textbox should be inside your ContentTemplate...
ASKER
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="tru e"/> in configuration or <%@ Page EnableEventValidation="tru e" %> 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.Regist erForEvent Validation 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?
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="tru
I do not want to turn Off my Event Validation though for this to work.... any suggestions?
well, it<s because you "created" the images buttons in the Page_Load.
- test, if you remove the avlidation, just to make sure it works without it, then pput it back
- 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.
avlidation = EventValidation
ASKER
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..
The OnClick function is refreshing the the whole page and not just my UpdatePanel section..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That worked perfectly.. Thank you for allllll your help :)
it was a pleasure, thanks for the grade, and next time add Ajax in your Zones.
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