I have a page which has two content areas (Left, Center). The Left hand content contains two repeaters, both of which have an imagebutton who's itemcommand triggers an update of the content in the Center area. The Center Area has an update panel in it. The triggers are dynamically generated because the repeaters are in panels, and I needed to use the findcontrol() command to get access to them.
Code works great on my laptop (localhost), gives an error when I move it to the server. Error is:
Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing this request on the server. The status code returned from the server was: 500.
Here's my UpdatePanel:
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Repeater ID="rMain" DataSourceID="srcMain" OnItemCommand="rmain_itemCommand" runat="server"> <ItemTemplate> <asp:Label ID="lblTitle" Text='<%#Eval("Description")%>' runat="server" CssClass="verorangeHeader" /><asp:Label ID="ProductID" runat="server" Text='<%# Eval("idProduct") %>' Visible="false"></asp:Label><asp:Label ID="lblSKU" runat="server" Text='<%# Eval("Sku") %>' Visible="False" /><br /><br /> <table border="0" cellpadding="1" cellspacing="1"> <tr> <td > <asp:Label ID="lblDetails" Text='<%#Eval("Details")%>' runat="server" CssClass="ver11bluebold" /> </td> <td ><img src='<%# formatPhoto(Eval("ImageURL")) %>' /></td> </tr> <tr> <td colspan="2" align="right" valign="top">Priced from: <asp:Label ID="lblPrice" Text='<%# formatPrice(Eval("Price")) %>' runat="server" CssClass="verorange" /> <asp:ImageButton ID="btnSpecifications" ImageURL="images/btn_specifications.gif" runat="server" /><asp:ImageButton ID="btnPhotoGallery" ImageURL="images/btn_photo-gallery.gif" runat="server" /><asp:ImageButton ID="btnBuyNow" ImageURL="images/buy-bm-clear.gif" runat="server" CommandName="Update" /></td> </tr> </table></ItemTemplate></asp:Repeater></ContentTemplate></asp:UpdatePanel>
Here's the code that creates the triggers:
Private Sub Page_Init(ByVal senderAs Object,ByVal eAs EventArgs)Handles MyBase.Init'Add TriggersDim ap1As AsyncPostBackTrigger =New AsyncPostBackTrigger()Dim ap2As AsyncPostBackTrigger =New AsyncPostBackTrigger() ap1.ControlID = pnlProduct1.FindControl("rY5").UniqueID ap1.EventName ="ItemCommand" ap2.ControlID = pnlProduct2.FindControl("r52").UniqueID ap2.EventName ="ItemCommand" UpdatePanel1.Triggers.Add(ap1) UpdatePanel1.Triggers.Add(ap2)End Sub
Any suggestions?
Jennifer
Take a look at this post...http://forums.asp.net/p/1139950/1831145.aspx
-Damien
Got it fixed. It was actually related to a bug in my Master Page!
Thanks for the help!
Jennifer
To fix this problem, you can add the follow code in your web.config
<system.web>
<pages validateRequest="false">
</system.web>.