Hi All,
I am using NetAdvantage NET 20081 CLR20. I implemented the WebAsyncRefreshPanel in my web application. I used in one usercontrol let say, myControl1, and myControl1 is again used in myControl2 and myControl2 is displayed on default.aspx. Fllowing is the way I implemented.
myControl1:HTML View-----------------------------------<table id="Table1" cellSpacing="1" cellPadding="1" width="300" border="0"><tr> <td style="HEIGHT: 24px"><asp:label id="lblMainHeading" CssClass="secondHeading" runat="server">Pacsmail Images</asp:label></td></tr><tr> <td><asp:image id="imgPacsmail" runat="server"></asp:image></td></tr><tr> <td align="center"> <igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" Height="20px" Width="80px"> <asp:label id="lblPrevious" CssClass="stdLabel" runat="server">Previous</asp:label> <asp:imagebutton id="imgBtnPreviousImage" runat="server" ImageUrl="~/Images/leftArrow.gif"></asp:imagebutton> <asp:imagebutton id="imgBtnNextImage" runat="server" ImageUrl="~/Images/rightArrow.gif"></asp:imagebutton> <asp:label id="lblNext" CssClass="stdLabel" runat="server">Next</asp:label> </igmisc:WebAsyncRefreshPanel> </td></tr></table>
myControl1: CodeBehind C#-----------------------------------------
this.WebAsyncRefreshPanel1.AddLinkedRequestTrigger("imgBtnPreviousImage"); this.WebAsyncRefreshPanel1.AddLinkedRequestTrigger("imgBtnNextImage"); this.WebAsyncRefreshPanel1.AddRefreshTarget("imgPacsmail");}public void Display(int reportID) { #region Pacsmail Images string pathPacsmailImages = Server.MapPath(".") + "\\Images\\Pacsmail\\" + reportID.ToString();
myControl1 in myControl2<td> <uc1:pacsmailimagesslideshow id="PacsmailImagesSlideShow1" runat="server"></uc1:pacsmailimagesslideshow></td>myControl2: PageLoad--------------------------------if((Request.QueryString.Get("type") != null) && (Request.QueryString.Get("reportid") != null)) { ControlsPanel.Visible = false; resultsGrid.Visible = false; string type = ""; int reportID = 0;
try { type = Request.QueryString.Get("type").ToString(); reportID = Convert.ToInt32(Request.QueryString.Get("reportid")); } catch { }
PacsmailImagesSlideShow1.Display(reportID); is called inside DisplayReferralReports(type, reportID) function.
It simply did not work. nothing happens, the image should change when user clicks on the next or prev button without post back. but nothing happens at all. when i remove the panel it works with a postback.
Need some help and suggestions.
Kind regards,
In the setup you have, the WARP panel will refresh it's contents, as well as the image with id imgPacsmail. No other content will be updated. It appears that you want your usercontrol to be updated, but your usercontrol lies outside of the WARP, and isn't linked as a Refresh Target. In order to update your usercontrol, you'll want to place it in a second WARP panel, and add the second WARP panel as a RefreshTarget of the first WARP panel.
Hope this helps,
-Tony