Dear Team,
I want to achieve the below.
I have a parent page which displays the details about a project. From this, on a button click , I open a radwindow which displays some specific details about the project which displayed in the parent window. The radpopup window has some textboxes and other controls with values along with a UPDATE button.
What I need is, if I change values in the popup and try to close the radwindow without update, it should ask me a confirmation that” Are you sure to close this window without updating your data? The changes will be lost!! Click on CANCEL to return to the window and update". If i try to close the popup radwindow after updated [ie,if I not changed any values after updated] or without any change, it should not ask the confirmation before close the radpopupwindow.
Please help me to achieve this.
<ClientSettings EnableRowHoverStyle="true"> <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True" /> <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="False" /> <ClientEvents OnRowSelected="PaymentLedgerRowSelected" /> <ClientEvents OnRequestStart="ThisEvent" /> </ClientSettings>For Each SelItem AS RadListBoxItem in Selectedlist availiablelist.Items.Add(SelItem) Next<asp:LinkButton ID="lnkComments" runat="server" Text="Add Comments"></asp:LinkButton> <div> <asp:Panel ID="panel1" runat="server" CssClass="modalPopup" Style="display: none" Width="500px" BackColor="#E6E6E6"> <p> Please add the comments</p> <asp:TextBox ID="txt_comments" runat="server" TextMode="MultiLine" Width="480px"></asp:TextBox> <div> <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel_Ok" LoadingPanelID="RadAjaxLoadingPanel1"> <asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click" CommandName="Ok" /> <asp:Button ID="CancelButton" runat="server" Text="Cancel" /> </telerik:RadAjaxPanel> </div> </asp:Panel> </div> <div> <asp:ModalPopupExtender ID="ModalPopUp_Comments" runat="server" TargetControlID="lnkComments" PopupControlID="panel1" BackgroundCssClass="modalBackground" CancelControlID="cancelButton" DropShadow="true"> </asp:ModalPopupExtender> </div>protected void OkButton_Click(object sender, System.EventArgs e) { ModalPopupExtender ModalPopUp_Comments = (ModalPopupExtender)RadGrid_cDetailsView.MasterTableView.Items[0].FindControl("ModalPopUp_Comments"); TextBox txt_comments = (TextBox)RadGrid_cDetailsView.MasterTableView.Items[0].FindControl("txt_comments"); RadGrid RadGrid_cComments =(RadGrid) RadGrid_cDetailsView.MasterTableView.Items[0].FindControl("RadGrid_cComments"); ModalPopUp_Comments.Hide(); cComments comments = new cComments(); CiscHeader cHeader = new CiscHeader(); cHeader.cId = Request.QueryString["ID"]; if(txt_comments.Text != "") { //comments.UserId = HttpContext.Current.User.Identity.Name; // for testing purposes only comments.UserId = "Anjali"; comments.UserComment = txt_comments.Text; } cHeader.AddcComments(comments); cScoringCtrl cscoringCtrl = new cScoringCtrl(); cscoringCtrl.savecComments(cHeader); txt_comments.Text = string.Empty; cHeader.cComment.Clear(); cscoringCtrl.getcComments(cHeader); RadGrid_cComments_Bind(cHeader, RadGrid_cComments); }