locked
ModalPopupExtender Panel new textbox value is not detected on the code behind RRS feed

  • Question

  • User-786564416 posted

    I have

    <%@ 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">
                    
                            
             .MainFieldsDivStyle
            {
                border-color: Black;
                width: 65%;
                border-style: solid;
                margin-top: 22px;
                background-color:#C9DCF2;
                opacity: 0.8;
                -moz-border-radius: 15px;
                -webkit-border-radius: 15px;
                border-radius: 15px;
            }     
    
             .PopuoPanelStyle
            {
                border-color: Black;
                width: 65%;
                border-style: solid;
                margin-top: 22px;
                background-color:#C9DCF2;
                opacity: 0.8;
                -moz-border-radius: 15px;
                -webkit-border-radius: 15px;
                border-radius: 15px;
            }  
            
             .ExCellStyle
            {
                background-color:#20FFFF;
                border-color:Black;
                border-style:solid;
                border-width:1px;
            }     
                 
            .CellStyle
            {
                border: 1px solid Black;
                background-color:#7DE6FF;
            }
              
            .HeaderLetterCellStyle
            {
                border: 1px solid Black;
                background-color: #96C2F2;
                
            }
    
            .BorderingStyle
            {
                border: 1px solid Black;
            }
    
            .CommentsHeaderStyle {
                border: 1px solid Black;
                background-color: #5D7B9D;
                text-align: center;
                color: #FFFFFF;
                font-family: "Sakkal Majalla";
                font-size: 26px;
            }
    
            .MessageHeaderStyle {
                border: 1px solid Black;
                text-align: center;
                color: #FFFFFF;
                font-family: "Sakkal Majalla";
                font-size: 26px;
            }
    
            .SubjectFieldStyle
            {
                font-family:"Sakkal Majalla";
                font-size:16pt;
            }  
            .CommentButton {
                margin-left: 14px;
            }
    
            .RequestButton {
                margin-left: 14px;
            }
    
            .HyperLinkStyle img
            {
                height:40px;
                width:70px;
                vertical-align:middle;   
            } 
            .CellStyle
            {
                background-color:#7DE6FF;
                border-color:Black;
                border-style:solid;
                border-width:1px;
            }
           
    
    
            .EmptyDataRowStyle
            {
                font-family:SC_AMEEN;
                font-size: 46px;
                width:100%;
                text-align:center;
            }
    
            .Grid
            {
                margin-right:0px;
                margin-top: 0px;
                margin-left: 0px;
                text-align: center;
                font-family: 'Sakkal Majalla';
                font-size: x-large;
            }
           
           .Buttonout
            {
                cursor:default;
                -moz-border-radius: 15px;
                -webkit-border-radius: 15px;
                border-radius: 15px;
            } 
              
             .Buttonhover
            {
                cursor:pointer;
                -moz-border-radius: 15px;
                -webkit-border-radius: 15px;
                border-radius: 15px;
            }
    
            .auto-style5 {
                margin-left: 5px;
            }
            
            .auto-style6 {
                text-align: right;
            }
    
    
            .modalBackground
            {
                background-color:black;
                filter:alpha(opacity=90);
                opacity:0.8;  
            }
    
            .modalpopup
            {
                background-color:#FFFFFF;
                border-width:3px;
                border-color:black;
                border-style:solid;
                padding-top:10px;
                padding-left:10px;
                width:700px;
                height:140px;    
            }
            
            .auto-style7 {
                height: 64px;
            }
            
            .auto-style8 {
                height: 150px;
            }
            .auto-style9 {
                border: 5px solid black;
                background-color:#C9DCF2;
                /*padding-top: 10px;*/
                /*padding-left: 10px;*/*/
                margin-top: 10px;
            }
            
            .auto-style10 {
                font-size: 24px;
            }
            
            </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>
    
        <%--<script type="text/javascript">
    
            $(document).on("idle.idleTimer", function (event, elem, obj) {
                // Once the timer is idle (after 10 seconds), perform an event (your redirect)
                alert("Session has Expired.You will be required to relogin.");
                window.location.href = 'SessionExpiry.aspx';
            });
    
            // Define a timer for 30 minutes
            $.idleTimer(30 * 60 * 1000);
    
        </script>--%><%--<script type="text/javascript">
    
            function OpenPopup()
            {
                popup("ExtendAnsweringDeadline.aspx");
                }
    
            function popup(url)
            {
    
            var width = 700;
    
            var height = 200;
    
            var left = (screen.width - width) / 2;
    
            var top = (screen.height - height) / 2;
    
            var params = 'width=' + width + ', height=' + height;
    
            params += ', top=' + top + ', left=' + left;
    
            params += ', directories=no';
    
            params += ', location=no';
    
            params += ', menubar=no';
    
            params += ', resizable=no';
    
            params += ', scrollbars=no';
    
            params += ', status=no';
    
            params += ', toolbar=no';
    
            newwin = window.open(url, 'windowname5', params);
            
    
        if (window.focus) { newwin.focus() }
    
        return false;
    
    }
    
        </script>--%>    
    
        <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePartialRendering="true">
        </asp:ToolkitScriptManager>
    
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    	<ContentTemplate>
                <div id="MainFields"  runat="server" class="MainFieldsDivStyle" >
                    <table id="PostingInformation" runat="server" width="90%">
                        <tr style="height:30px;" >
                            <td colspan="2">
                            </td>
                            <td width="22%" colspan="2">
                            </td>
                        </tr>
                        <tr>
                    
                            <td align="center" class="ExCellStyle" colspan="2">
                                <asp:Label ID="FromLabel0" runat="server" BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="38px" style="font-size: 32px; margin-right: 5px; font-family: 'sakkal Majalla'; text-align: center;" Text="مـــــــــــــــــــــن"></asp:Label>
                                </td>
                            <td align="right" class="ExCellStyle" colspan="2">
                                </td>
                
                        </tr>
    
                        <tr>
                            <td align="right" colspan="2">
                                <asp:TextBox ID="SourceTxtBox" runat="server" Height="35px" style="font-family: 'Sakkal Majalla'; font-size: 24px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black; " Width="540px" ReadOnly="True"></asp:TextBox>
                            </td>
                            <td align="right" class="ExCellStyle" colspan="2">
                                &nbsp;</td>
                        </tr>
    
                        <tr style="height:40px; " >
                            <td align="right" colspan="2">
                            </td>
                            <td align="right" colspan="2">
                            </td>
                        </tr>
        
                        <tr>
                            <td align="center" class="CellStyle" colspan="2">
                                <asp:Label ID="ToLabel0" runat="server" BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="38px" style="font-size: 32px; margin-right:5px; font-family: 'sakkal Majalla'; text-align: center;" Text="إلــــــــــــــــــــى" BorderColor="Black"></asp:Label>
                            </td>
                            <td align="right" class="CellStyle" colspan="2"></td>
                        </tr>
        
                        <tr>
                            <td align="right" colspan="2">
                                <asp:TextBox ID="TargetTxtBox" runat="server" Height="35px" style="font-family: 'Sakkal Majalla'; font-size: 24px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black; " Width="540px" ReadOnly="True"></asp:TextBox>
                            </td>
                            <td align="right" class="CellStyle" colspan="2">
                                &nbsp;</td>
                        </tr>
        
                        <tr style="height:40px; " >
                            <td align="right" colspan="2" >
                                </td>
                            <td align="right" colspan="2">
                                </td>
                        </tr>
    
                        <tr>
                            <td align="center" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="LetterHeadLabel" runat="server" BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" style="font-size: 34px; margin-right:5px; font-family: 'sakkal Majalla'; text-align: center;" Text="الرســـالة" Width="93px"></asp:Label>
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2"></td>
                        </tr>
                        <tr>
                            <td align="right" colspan="2">
                                <asp:TextBox ID="LetterIDTxtBox" runat="server" Height="35px" style="font-family: 'Sakkal Majalla'; font-size: 24px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black; " Width="540px" ReadOnly="True"></asp:TextBox>
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="LetterIDLabel" runat="server" BorderColor="Black" BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="30px" style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" Text="مرجع المراسلة" Width="110px"></asp:Label>
                            </td>
                        </tr>
    
                        <tr>
                            <td align="right" colspan="2">
                        
                                <asp:textbox ID="TimingTxtBox" runat="server" Height="35px" 
                            
                                    style="font-family: 'Sakkal Majalla'; font-size: 24px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black; " 
                                    Width="540px" ReadOnly="True"></asp:textbox>
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="Label1" runat="server" Text="تاريخ المراسلة" 
                                    BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="30px" 
                            
                                    style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" 
                                    BorderColor="Black" Width="110px" 
                                    ></asp:Label>
                            </td>
                        </tr>
    
                
                        <tr>
                            <td align="right" colspan="2">
                        
                                <asp:textbox ID="SubjectTxtBox" runat="server" Height="35px"
                            
                                    style="font-family: 'Sakkal Majalla'; font-size: 24px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black; " 
                                    Width="540px" ReadOnly="True"></asp:textbox>
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="SubjectLabel" runat="server" Text="الموضــوع" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                                style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" 
                                    BorderColor="Black" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
    
    
                        <tr id="CommentsRow" runat="server"  >
                            <td align="right" colspan="2">
                                <asp:TextBox ID="CommentsTxtBox" runat="server" TextMode="MultiLine" Height="100px"
                                Width="540px" BorderColor="Black" BorderStyle="Solid" Style="font-size: 22px;
                                font-family: 'Sakkal Majalla'; text-align: right;" MaxLength="400" 
                                    onkeyup="textCounter(this,400);" ReadOnly="True"></asp:TextBox>
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="CommentsLabel" runat="server" Text="الملاحظات" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                                style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" 
                                    BorderColor="Black" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
    
                        <tr>
                            <td style="text-align: left" colspan="2">
                                <asp:TextBox ID="DeadLineTxtBox" runat="server" Height="40px" ReadOnly="True" style="font-family: 'Sakkal Majalla'; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="540px" CssClass="auto-style10"></asp:TextBox>
                            </td>
                            
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="DeadLineLabel" runat="server" Text="الموعد النهائي" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                        
                                    style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
    
                        <tr id="ImportanceRow" runat="server" >
                            <td style="text-align: right" colspan="2">
                        
                                <asp:Image ID="HighImportant" runat="server" Width="50px" Height="40px"  
                                    ImageUrl="~/Images/HighImportance.jpg" BorderColor="Black" 
                                    BorderStyle="none" BorderWidth="0px" 
                                    style="margin-left: 0px; margin-right:1px; " />
                        
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="ImportanceLabel" runat="server" Text="الأهمية" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                                style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
                            
    
                        <tr>
                            <td style="text-align: right" colspan="2" > 
                                <asp:textbox ID="ProcessingStatusTxtBox" runat="server" Height="40px"
                                style="font-family: 'Sakkal Majalla'; font-size: 24px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black; " 
                                Width="540px" ReadOnly="True"></asp:textbox>
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2">
                                <asp:Label ID="ProcessingStatusLabel" runat="server" Text="الحالة" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                        
                                    style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
    
                        <tr id="AttachmentRow" runat="server" >
    
                            <td align="right" style="text-align: right" colspan="2">
                        
                                <asp:HyperLink ID="AttachmentLink" runat="server"  Target="_blank" ImageUrl="~/Images/Attachment1.png"  CssClass="HyperLinkStyle"> </asp:HyperLink>
                        
                                <br />
                      
                            </td>
                            <td align="right" class="HeaderLetterCellStyle" colspan="2" >
                                <asp:Label ID="AttachmentLabel" runat="server" Text="وثيقة المراسلة" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                                    style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
    
                        <%--<tr id="NewDeadLineRow" runat="server" visible="false">
                            <td class="auto-style1">
                                <asp:Button ID="SendRequest" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="39px" 
                                onMouseOut="this.className='Buttonout'" onMouseOver="this.className='Buttonhover'" 
                                style="margin-left: 0px;font-size: 30px; font-family: sc_AMEEN;
                                -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" 
                                Text="أرسل" UseSubmitBehavior="False" Width="130px" />
                            </td>
                            <td align="right">
                                &nbsp;</td>
                            <td style="text-align: right">
                                &nbsp;</td>
                            
                            <td align="right" class="HeaderLetterCellStyle">
                                <asp:Label ID="Label2" runat="server" Text="الموعد المطلوب" 
                                BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" 
                        
                                    style="font-size: 26px; margin-right:5px;  font-family: 'Sakkal Majalla'; text-align: right;" Width="110px" 
                                ></asp:Label>
                            </td>
                        </tr>
    
                        <tr id="ClosingRec" runat="server" visible="false" align="left" >
                            <td colspan="4" style="border:solid black 1px;background-color:lightblue;">
                                <asp:ImageButton ID="CloseRequestRecords" runat="server" Height="15px" ImageUrl="~/Images/NewClose.png" Width="18px" CausesValidation="False" />
                            </td>
                        </tr> 
    
                        <tr id="RequestSentMsgRecord" runat="server" visible="false">
                            <td colspan="4" style="border:solid black 1px;background-color:lightblue;" align="center" class="auto-style4">
                             <asp:Label ID="MessageSentLabel" runat="server" Text="تم إرسال طلب التمديد" CssClass="auto-style3"></asp:Label>
                            </td>
                        </tr> 
                        
                        <tr id="ShowRequestsBtnRec" runat="server" >
                            <td colspan="4" style="border:solid black 1px;background-color:lightblue;" align="center" class="auto-style4">
                                <asp:Button ID="ShowRequestRecords" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="39px" onMouseOut="this.className='Buttonout'" onMouseOver="this.className='Buttonhover'" style="margin-left: 0px;font-size: 30px; font-family: sc_AMEEN;
                                -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Text="عرض سجل الطلبات" UseSubmitBehavior="False" Width="155px" />
                            </td>
                        </tr> --%>
    
                        <tr id="ExtendingRow1" runat="server" >
                            <td class="CommentsHeaderStyle" colspan="4">
                               سجل طلبات التمديد</td>
                        </tr>      
                
                        <tr align="center" id="ExtendingRow2" runat="server" >
                            <td colspan="4">
                                <asp:GridView ID="GridView2" runat="server" DataSourceID="SDS2" CssClass="Grid"    
                                CellPadding="4" ForeColor="#333333" GridLines="Vertical" BackColor="#99CCFF" 
                                BorderStyle="Solid" AutoGenerateColumns="False" Width="100%"  
                                EmptyDataText="لا توجد أي طلبات تمديد" AllowSorting="True"  BorderColor="Black" BorderWidth="2px"  >
                                <Columns>
    
                                    
    
                                    <asp:TemplateField HeaderText="التاريخ" >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentTimeField" runat="server" text='<%# (Eval("CommentTime")).toshortdatestring() %>'   />  
                                        </ItemTemplate>
                                        <ItemStyle BorderWidth="1px" Width="15%" HorizontalAlign="right" Font-Size="15px"  Font-Names="Courier New"/>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField HeaderText="الملاحظة"  >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentField" runat="server" text='<%# Eval("Comment")  %>'    />  
                                        </ItemTemplate>
                                        <ItemStyle BorderWidth="1px" Width="40%" HorizontalAlign="right" Font-Size="20px" Font-Names="sakkal Majalla" />
                                    </asp:TemplateField>
    
                                    <asp:TemplateField>
                                        <HeaderStyle Height="20px" /> 
                                        <ItemTemplate>
                                            <asp:RadioButton ID="GridView1_RadioButton" runat="server"  AutoPostBack="True" GroupName="RadioGroup" OnCheckedChanged="GridView1_RadioButton_CheckedChanged" />
                                        </ItemTemplate> 
                                        <ItemStyle BorderWidth="1px" Width="2%" /> 
                                    </asp:TemplateField>
                            
                                    <asp:TemplateField Visible="false" >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentatorID" runat="server" text='<%# Eval("Commentator")%>'  Visible="false" />  
                                        </ItemTemplate>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField Visible="false" >
                                        <ItemTemplate>
                                            <asp:Label ID="CmtTime" runat="server" text='<%# Eval("CommentTime")%>'  Visible="false" />  
                                        </ItemTemplate>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField Visible="false" >
                                        <ItemTemplate>
                                            <asp:Label ID="ByUserIndx" runat="server" text='<%# Eval("ByUserIndx")%>'  Visible="false" />  
                                        </ItemTemplate>
                                    </asp:TemplateField>
    
                            
                                </Columns> 
                        
                                <EditRowStyle BackColor="#999999" />
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" Font-Size="22px" Font-Names="Sakkal Majalla"    />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" BorderColor="Black" BorderStyle="Outset" BorderWidth="2px" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                                <EmptyDataRowStyle Font-Names="Sakkal Majalla" Font-Size="26px" HorizontalAlign="Center" Width="100%" />
                                <EmptyDataTemplate>
                                    <div>
                                        لا توجد أي طلبات تمديد
                                    </div> 
                                </EmptyDataTemplate>
                        
                
    
                            </asp:GridView>
                            </td>
                        </tr>
    
                        <tr id="Tr1" runat="server" style="height:60px;" align="center"  >
                            <td width="630px" colspan="4" style="border-top: 1px none Black;border-left: 1px none Black;border-right: 1px none Black; " >
                                <asp:ImageButton ID="DeleteRequest" runat="server" Width="50px" CssClass="CommentButton" ImageUrl="~/Images/DeleteComment.png" ToolTip="حذف التعليق"  />
                                <asp:ImageButton ID="ExtendDeadline" runat="server" BorderStyle="None" BorderWidth="0px" CssClass="CommentButton" Height="50px" ImageUrl="~/Images/AddComment.png" ToolTip="إضافة تعليق" Width="52px" OnClientClick="OpenPopup();" />
                            </td>
                        </tr> 
    
                        <tr>
                            <td colspan="4">
                            </td>
                        </tr>
    
                        
                
                        <tr>
                            <td class="CommentsHeaderStyle" colspan="4">
                                التعليقات</td>
                        </tr>      
                
                        <tr align="center">
                            <td colspan="4">
                                <asp:GridView ID="GridView1" runat="server" DataSourceID="SDS2" CssClass="Grid"    
                                CellPadding="4" ForeColor="#333333" GridLines="Vertical" BackColor="#99CCFF" 
                                BorderStyle="Solid" AutoGenerateColumns="False"  
                                EmptyDataText="لا توجد أي سجلات" AllowSorting="True"  BorderColor="Black" BorderWidth="2px"  >
                                <Columns>
    
                                    <asp:TemplateField HeaderText="بواسطة" >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentatorName" runat="server" />  
                                        </ItemTemplate>
                                        <ItemStyle BorderWidth="1px" Width="45%" HorizontalAlign="right" Font-Size="20px" Font-Names="sakkal Majalla"/>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField HeaderText="التاريخ" >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentTimeField" runat="server" text='<%# (Eval("CommentTime")).toshortdatestring() %>'   />  
                                        </ItemTemplate>
                                        <ItemStyle BorderWidth="1px" Width="15%" HorizontalAlign="right" Font-Size="15px"  Font-Names="Courier New"/>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField HeaderText="الملاحظة"  >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentField" runat="server" text='<%# Eval("Comment")  %>'    />  
                                        </ItemTemplate>
                                        <ItemStyle BorderWidth="1px" Width="40%" HorizontalAlign="right" Font-Size="20px" Font-Names="sakkal Majalla" />
                                    </asp:TemplateField>
    
                                    <asp:TemplateField>
                                        <HeaderStyle Height="20px" /> 
                                        <ItemTemplate>
                                            <asp:RadioButton ID="GridView1_RadioButton" runat="server"  AutoPostBack="True" GroupName="RadioGroup" OnCheckedChanged="GridView1_RadioButton_CheckedChanged" />
                                        </ItemTemplate> 
                                        <ItemStyle BorderWidth="1px" Width="2%" /> 
                                    </asp:TemplateField>
                            
                                    <asp:TemplateField Visible="false" >
                                        <ItemTemplate>
                                            <asp:Label ID="CommentatorID" runat="server" text='<%# Eval("Commentator")%>'  Visible="false" />  
                                        </ItemTemplate>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField Visible="false" >
                                        <ItemTemplate>
                                            <asp:Label ID="CmtTime" runat="server" text='<%# Eval("CommentTime")%>'  Visible="false" />  
                                        </ItemTemplate>
                                    </asp:TemplateField>
    
                                    <asp:TemplateField Visible="false" >
                                        <ItemTemplate>
                                            <asp:Label ID="ByUserIndx" runat="server" text='<%# Eval("ByUserIndx")%>'  Visible="false" />  
                                        </ItemTemplate>
                                    </asp:TemplateField>
    
                            
                                </Columns> 
                        
                                <EditRowStyle BackColor="#999999" />
                                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" BorderColor="Black" BorderStyle="Solid" BorderWidth="2px" Font-Size="22px" Font-Names="Sakkal Majalla"    />
                                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" BorderColor="Black" BorderStyle="Outset" BorderWidth="2px" />
                                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                                <EmptyDataRowStyle Font-Names="Sakkal Majalla" Font-Size="26px" HorizontalAlign="Center" />
                                <EmptyDataTemplate>
                                    <div>
                                        لا توجد أي ملاحظات
                                    </div> 
                                </EmptyDataTemplate>
                        
                
    
                            </asp:GridView>
                            </td>
                        </tr>
                        <tr align="center" >
                            <td width="630px" colspan="4" style="border-top: 1px none Black;border-left: 1px none Black;border-right: 1px none Black; " >
                                <asp:ImageButton ID="DeleteComment" runat="server" Width="50px" CssClass="CommentButton" ImageUrl="~/Images/DeleteComment.png" ToolTip="حذف التعليق"  />
                                <asp:ImageButton ID="AddComment" runat="server" BorderStyle="None" BorderWidth="0px" CssClass="CommentButton" Height="50px" ImageUrl="~/Images/AddComment.png" ToolTip="إضافة تعليق" Width="52px" />
                                <asp:TextBox ID="RemarksTextBox" runat="server" BorderColor="Black" BorderStyle="Solid" Height="58px" 
                                    style="resize:none;margin-top: 5px; margin-left: 9px; text-align: right; font-size: 24px;
                                -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" 
                                TextMode="MultiLine" Width="350px" Font-Names="Sakkal Majalla" Font-Size="20px"></asp:TextBox>
                            </td>
    
                        </tr>
                        <tr id="RemarkerHolder" runat="server"  >
                            <td colspan="4" style="border-bottom : 1px none Black;border-right : 1px none Black;border-left : 1px none Black; text-align: right;">
                                <asp:DropDownList ID="RemarkerDD" runat="server" 
                                    style="text-align: right; margin-top: 5px; margin-right:10px;  font-size: 22px; font-family: 'Sakkal Majalla';
                                    -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Width="288px" DataSourceID="SDS1" DataTextField="UnitName" DataValueField="UnitIndx" AutoPostBack="True" Visible="False"
                                    onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'">
                                </asp:DropDownList>
                                <asp:Label ID="RemarkerLabel" runat="server" Text="بواسطة" style=" margin-bottom:5px;margin-right:10px;margin-left:5px;     font-size: 20px; font-family: 'Sakkal Majalla'; font-weight: 700;" Height="33px" Width="50px" Visible="False"></asp:Label>
                            </td>
                        </tr>
                                  
    
                <tr>
                    <td align="left" colspan="2" >
                        <asp:ImageButton ID="CloseThisPage" runat="server" CausesValidation="False" CssClass="ImgBtnStyle" Height="40px" ImageUrl="~/Images/CloseThisPage.png" Width="50px" />
                    </td>
                </tr>
    
                
            </table>
        </div>
        
                <asp:panel id="Panel1" runat="server" CssClass="auto-style9" Height="185px" Width="520px">
                <table width="100%" class="auto-style8">
                    <tr>
                        <td align="left" colspan="4">
                            <asp:ImageButton ID="CloseMe" runat="server" CausesValidation="False" Height="16px" ImageUrl="~/Images/NewClose.png" Width="20px" />
                        </td>
                    </tr>
                    <tr>
                        <td style="width:10%" class="auto-style6">
                        </td>
                        <td class="auto-style6" style="width:50%">
                            <asp:TextBox ID="PopUpDeadLineTxtBox" runat="server" Height="40px" ReadOnly="True" style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="250px"></asp:TextBox>
                        </td>
                        <td align="right" class="HeaderLetterCellStyle" style="width:30%">
                            <asp:Button ID="OfficeLabel" runat="server" BackColor="#DBDBDB" BorderColor="Black" BorderStyle="None" BorderWidth="1px" ForeColor="Black" Height="32px" OnClientClick="return false" style="text-align: right; font-size: 30px; font-family: SC_AMEEN; background-color:#96C2F2" Text="الموعد الحالي" Width="120px" />
                         </td>
                        <td style="width:10%" class="auto-style6"></td>
                    </tr>
                    <tr>
                        <td class="auto-style6">
                            <asp:ImageButton ID="imgPopup2" runat="server" CausesValidation="False" CssClass="auto-style5" Height="35px" ImageAlign="Top" ImageUrl="~/Images/Calender.png" style="margin-right:5px" Width="30px" />
                        </td>
                        <td class="auto-style6" >
                            <asp:TextBox ID="NewPopupDeadLineTxtbox" runat="server" Height="40px" ReadOnly="True" style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="250px"></asp:TextBox>
                            <asp:CalendarExtender ID="PopUpCalendar" runat="server" Format="dd-MMMM-yyyy HH:mm:ss" PopupButtonID="imgPopup2" TargetControlID="NewPopupDeadLineTxtbox">
                            </asp:CalendarExtender>
                        </td>
                        <td align="right" class="HeaderLetterCellStyle">
                            <asp:Button ID="OfficeLabel0" runat="server" BackColor="#DBDBDB" BorderColor="Black" BorderStyle="None" BorderWidth="1px" ForeColor="Black" Height="32px" OnClientClick="return false" style="text-align: right; font-size: 30px; font-family: SC_AMEEN; background-color:#96C2F2" Text="الموعد الجديد" Width="120px" />
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td colspan="4" align="center" class="auto-style7">
    
                            <asp:Button ID="OKBtn" runat="server" BackColor="#6262FF"  
                            ForeColor="White" Height="40px" style="text-align: center; font-size: 28px; margin-top: 15px; margin-bottom: 5px; font-family: sc_AMEEN; margin-left: 0px;
                            -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;margin-top:10px;margin-bottom:10px;" 
                            Text="استمرار" Width="167px"
                            onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" CausesValidation="False" UseSubmitBehavior="False" />
    
                        </td>
                    </tr>
                </table>
                
            </asp:panel>
            
                
            
                <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" OkControlID="OKBtn" CancelControlID="CloseMe"  PopupControlID="Panel1" DropShadow="true" TargetControlID="ExtendDeadline" BackgroundCssClass="modalBackground">
                </asp:ModalPopupExtender>
    
        </ContentTemplate> 
        </asp:UpdatePanel> 
    
        
    
        <div id="ExtraItems" runat="server" visible="false" >
            <table id="TmpTable" runat="server">   
                <tr>
                    <td>
                        <asp:SqlDataSource ID="SDS1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:TrackingConnectionString %>" 
                        SelectCommand="SELECT DISTINCT UserAuthorizedUnits.UnitIndx, UserAuthorizedUnits.UnitName FROM UserAuthorizedUnits INNER JOIN PendingCommentsRemarkerHeadsUnitsList ON UserAuthorizedUnits.LoadedByUserName = PendingCommentsRemarkerHeadsUnitsList.LoadedByUserName AND UserAuthorizedUnits.UnitIndx = PendingCommentsRemarkerHeadsUnitsList.Indx WHERE (UserAuthorizedUnits.LoadedByUserName = @LoadedByUserName)">
                            <SelectParameters>
                                <asp:SessionParameter Name="LoadedByUserName" SessionField="username" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td> 
                </tr>
                <tr>
                    <td>
                        <asp:SqlDataSource ID="SDS2" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:TrackingConnectionString %>" 
                        SelectCommand="SELECT DISTINCT [Comment], [CommentTime], [Commentator],[ByUserIndx] FROM [SupervisionComments] WHERE ([LetterID] = @LetterID) ORDER BY CommentTime DESC">
                            <SelectParameters>
                                <asp:SessionParameter Name="LetterID" SessionField="pendingletterid" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:SqlDataSource ID="SDS3" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:TrackingConnectionString %>" 
                        SelectCommand="SELECT DISTINCT [RequestID],[LetterID],[RequestingTime] FROM [ExtendingAnsweringDateRequests] WHERE ([LetterID] = @LetterID) ORDER BY RequestingTime">
                            <SelectParameters>
                                <asp:SessionParameter Name="LetterID" SessionField="pendingletterid" Type="String" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td>
                </tr>
                
            </table>
            
         </div>          
            
    </asp:Content>
    
    

    <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" OkControlID="OKBtn" CancelControlID="CloseMe"  PopupControlID="Panel1" DropShadow="true" TargetControlID="ExtendDeadline" BackgroundCssClass="modalBackground">
    </asp:ModalPopupExtender>

    When the popup Panel1 is shown, the user can change the value of the textbox "NewPopupDeadLineTxtbox" by using the calender control. However, when the user click the Panel1 OKControlID, "OKBtn", the new value of the NewPopupDeadLineTxtBox.text is not reflected.  It keeps having the same initial value when the Panel1 was showing.

    Protected Sub OKbtn_Click(sender As Object, e As EventArgs) Handles OKBtn.Click
       NewDeadLineValue = NewPopupDeadLineTxtbox.Text
    End Sub

    So how to get the last value of the textbox entered by the user when the OkBtn clicked?

    Tuesday, August 28, 2018 11:10 PM

Answers

  • User2103319870 posted

    alihusain_77

    <asp:TextBox ID="NewPopupDeadLineTxtbox" runat="server" Height="40px" ReadOnly="True" style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="250px"></asp:TextBox>

    The issue here is you have made the textbox  readonly. if you make textbox readonly then you wont be able to get the value in code behind because the values of disabled controls is not submitted with the form in the POST request.

    As a solution you can set the textbox to readonly in code behind

     protected void Page_Load(object sender, EventArgs e)
            {
                //Set the textbox to readonly
                NewPopupDeadLineTxtbox.Attributes.Add("readonly", "true");
            }

    You also need to remove the readonly property from textbox

      <asp:TextBox ID="NewPopupDeadLineTxtbox" runat="server" Height="40px" style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="250px"></asp:TextBox>
                      

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 28, 2018 11:56 PM

All replies

  • User2103319870 posted

    alihusain_77

    <asp:TextBox ID="NewPopupDeadLineTxtbox" runat="server" Height="40px" ReadOnly="True" style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="250px"></asp:TextBox>

    The issue here is you have made the textbox  readonly. if you make textbox readonly then you wont be able to get the value in code behind because the values of disabled controls is not submitted with the form in the POST request.

    As a solution you can set the textbox to readonly in code behind

     protected void Page_Load(object sender, EventArgs e)
            {
                //Set the textbox to readonly
                NewPopupDeadLineTxtbox.Attributes.Add("readonly", "true");
            }

    You also need to remove the readonly property from textbox

      <asp:TextBox ID="NewPopupDeadLineTxtbox" runat="server" Height="40px" style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 2px; border-style:solid; border-color:Black; " Width="250px"></asp:TextBox>
                      

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, August 28, 2018 11:56 PM
  • User-893317190 posted

    Hi alihusain_77,

    It seems that you need the textbox is not editable and the user could only enter date through the calendar.

    If so , you could also use jquery datepicker. It even  doesn't need a control to trigger the calendar.

    Below is a small sample for datepicker.If you don't need the button ,just remove it and the click event bound to it.

       <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
    
      <script src="https://code.jquery.com/jquery-1.12.4.js"></script>
      <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    </head>
    <body>
        <form id="form1" runat="server">
            
            
            <input type="button" id="btn"  value="showWidge" /><asp:TextBox ID="NewPopupDeadLineTxtbox" runat="server"></asp:TextBox>
            <script>
                $(function () {
                    $("#NewPopupDeadLineTxtbox").datepicker();
                    $("#btn").click(
    
                        function () {
                    $( "#NewPopupDeadLineTxtbox" ).datepicker( "show" );
                        }
                    )
    
                })
       
            </script>
        </form>

    For more information about datepicker , please refer to  https://jqueryui.com/datepicker/

    Best regards,

    Ackerly Xu

    Thursday, August 30, 2018 8:00 AM
  • User-1171043462 posted

    Here's the solution to get value from Read Only TextBox

    Protected Sub OKbtn_Click(sender As Object, e As EventArgs) Handles OKBtn.Click
       NewDeadLineValue = Request.Form[NewPopupDeadLineTxtbox.UniqueID]
    End Sub

    Ref: Get value of ReadOnly TextBox in ASP.Net and retain its value across PostBack

    Thursday, August 30, 2018 10:11 AM