Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Dynamically Changing the content of ModalPopupExtender Panel

$
0
0

I have a button, "DeleteRequest". When clicking this button, I want to show modal popup panel "Panel2". Panel2 has a label "DeleteRequestMessage". I want to change the label text dynamically from code-behind, plus running some code.

The problem I have is that the Panel2 is shown before the: label text changes, and the running of the code. 

The aspx page is as following:

<%@ Page Language="VB" MasterPageFile="~/MasterPages/MyMasterPage.master" AutoEventWireup="false" CodeFile="ShowPostingDetails.aspx.vb" Inherits="Pending_ShowPostingDetails"  MaintainScrollPositionOnPostback="true" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><style type="text/css">
.
.
.</style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="CpMainContent" Runat="Server"><!-- Required jQuery Reference --><script type="text/javascript" src="<%= ResolveUrl("~/jquery/js/jquery-1.8.2.min.js")%>"></script><!-- Idle Timer Plugin Reference --><script type="text/javascript" src="<%= ResolveUrl("~/jquery/js/idle-timer.min.js")%>"></script>    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePartialRendering="true"></asp:ToolkitScriptManager><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate>
.
.
.<asp:ImageButton ID="DeleteRequest" runat="server" Width="50px" CssClass="CommentButton" ImageUrl="~/Images/DeleteComment.png" ToolTip="حذف طلب تمديد مهلة الإجابة"  />
.       
.
.<asp:panel id="Panel2" runat="server" CssClass="auto-style13" Height="131px" Width="520px" Style="display:none"><table width="100%" class="auto-style12"><tr><td align="center" colspan="4" class="auto-style16"><asp:Label ID="DeleteRequestMessage" runat="server" CssClass="auto-style17" Height="45px" Text="Label" Width="450px"></asp:Label></td></tr><tr><td colspan="4" align="center"><asp:Button ID="ClosePanel2" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="40px" onMouseOut="this.className='Buttonout'" onMouseOver="this.className='Buttonhover'" style="text-align: center; font-size: 28px;  font-family: sc_AMEEN; margin-left: 0px;
                            -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Text="استمرار" UseSubmitBehavior="False" Width="167px" /></td> </tr></table></asp:panel><asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" OkControlID="ClosePanel2" PopupControlID="Panel2" DropShadow="true" TargetControlID="DeleteRequest" BackgroundCssClass="modalBackground"></asp:ModalPopupExtender></ContentTemplate> </asp:UpdatePanel> 

The event code that I want to run before showing the Panel2 and its content that I want to change dynamically according to the variable value "DeletingRequestMessage", is as following:

    Protected Sub DeleteRequest_Click(sender As Object, e As ImageClickEventArgs) Handles DeleteRequest.Click

        Dim DeletingRequestMessage As String

        If Session("RequestStatus") <> "بالانتظار" Then
            DeletingRequestMessage = "لا يمكن حذف الطلب لأنه تم اتخاذ الإجراء بشأنه"
            DeleteRequestMessage.Text = DeletingRequestMessage
            GoTo DeleteRequestSkip
        End If

        If CInt(Session("RequestingUserIndx")) = TDClass.GetLoggingUserIndxValue(Session("username")) Or TDClass.CheckDataEntryRight(Session("username"), Session("RequestingUnitIndx")) Then
            DeletingRequestMessage = "حذف طلب تمديد مهلة الإجابة"
            DeleteRequestMessage.Text = DeletingRequestMessage
            PerformRequestDeletion()
        Else
            DeletingRequestMessage = "صلاحية حذف طلب تمديد مهلة الإجابة غير متوفرة"
            DeleteRequestMessage.Text = DeletingRequestMessage
        End If




DeleteRequestSkip:
        ModalPopupExtender2.Show()

    End Sub

So how to solve this problem, so I can first run the PerformRequestDeletion()  procedure and then show the Panel2 with the label message with variable valueDeletingRequestMessage ?
 

Please help with great thanks


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>