i have a pop up which has formview and a save button. i want to refresh update panel when i click save button which is in pop up. How can i do this without asyncpostback? thanks for helps
<asp:ImageButton ID="imgSavePhoto" runat="server" ImageUrl="Images/PhotoCompIcons/32x32/Document2.png" ImageAlign="AbsMiddle" ToolTip="Yeni Kayıt" />
<asp:ModalPopupExtender ID="mpeInsert" runat="server" TargetControlID="imgSavePhoto" CancelControlID="btnClose" PopupControlID="pnlModalPopup" BackgroundCssClass="modalBackground"></asp:ModalPopupExtender>
<asp:Panel ID="pnlModalPopup" runat="server" CssClass="modalPopup" align="center" Style="display: none">
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<div class="CloseButton">
<asp:ImageButton ID="btnClose" runat="server" ImageUrl="~/dialog_close.ico" ToolTip="Kapat" ImageAlign="AbsMiddle" />
</div>
<div class="RecordType">
<asp:Label ID="lblRecordTypeName" runat="server" Font-Size="Medium" Font-Bold="true"></asp:Label>
</div>
<asp:FormView ID="fvCompPartPhotos" runat="server" DataKeyNames="ID" DataSourceID="odsCompPartPhotos" DefaultMode="Insert" EnableModelValidation="True" OnDataBound="fvCompPartPhotos_DataBound1" OnItemCommand="EditPhotoCommands" Style="margin-left: 0px">
<InsertItemTemplate>
//some codes
</InsertItemTemplate>
</asp:FormView>
</ContentTemplate>
</asp:UpdatePanel>
<div class="PhotoEditButtons">
<asp:ImageButton ID="imgClear" runat="server" ImageUrl="Images/PhotoCompIcons/32x32/Document2.png" ImageAlign="AbsMiddle" ToolTip="Yeni Kayıt" OnClick="imgClear_Click" /> |
<asp:ImageButton ID="imgSaveNew" runat="server" ImageUrl="Images/PhotoCompIcons/32x32/Save.png" ImageAlign="AbsMiddle" ToolTip="Kaydet" OnClick="imgSaveNew_Click" />
<asp:AsyncFileUpload ID="fuPhoto" runat="server" />
</div>
As discussed you want to refresh the UpdatePanel
without asyncpostback
.
Here you go:-
Solution
YourUpdatePanelId.Update();
have a look here for documentation
On button click
you can set it easily
protected void Button1_Click(object sender, EventArgs e)
{
if (LastUpdate.AddSeconds(5.0) < DateTime.Now)
{
UpdatePanel1.Update();
LastUpdate = DateTime.Now;
}
}
You need to customize according to your requirement, that's it..!!!!