I have the following Panel that was shown on separate form, that has custom validation message. Now, I want to show it as modalpopupextender along with its custom validation
The Panel code:
<asp:toolkitscriptmanager ID="ScriptManager1" runat="server" /><asp:Panel ID="Panel1" runat="server" CssClass="PanelStyle" ><table id="MessageTable" runat="server" style="width:100%;"><tr><td align="left"><asp:ImageButton ID="Panel1Cancel" runat="server" Height="16px" ImageUrl="~/Images/NewClose.png" Width="20px" CausesValidation="False" /></td></tr><tr align="center" style="height:60px;"><td colspan="5"><asp:Label ID="Label3" runat="server" style="font-family: 'sakkal Majalla'; font-size: 30px" Text="المعلومات الواردة مع الرسالة"></asp:Label></td></tr><tr ><td width="10%" class="auto-style30"></td><td width="5%" class="auto-style30"></td><td class="auto-style30" ><asp:TextBox ID="Panel1PostRefNo" runat="server" BorderColor="Black" BorderStyle="Solid" Height="32px" style="border:solid black 1px; font-family: 'sakkal Majalla'; font-size: 24px; text-align: right;border-color:black;border-style:solid;border-width:1px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Width="275px"></asp:TextBox></td><td class="auto-style31" width="25%"><asp:Label ID="Label1" runat="server" Text="مرجع الرسالة" CssClass="auto-style34"></asp:Label></td><td width="10%" class="auto-style30"></td></tr><tr><td align="right"><asp:CustomValidator ID="IncomingDateValidator" runat="server"
Display="Dynamic" ErrorMessage="التاريخ يجب أن لا يكون بعد تاريخ اليوم"
style="font-size: 28px; color: #FF0000; ">*</asp:CustomValidator></td><td style="text-align: right;"><asp:ImageButton ID="Panel1imgPopup" runat="server" Height="32px" ImageAlign="Right" ImageUrl="~/Images/Calender.png" Width="35px" /></td><td ><asp:TextBox ID="Panel1IncomingDateValue" runat="server" Height="32px"
style="border:solid black 1px; font-family: 'sakkal Majalla'; font-size: 24px; text-align: right;border-color:black;border-style:solid;border-width:1px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Width="275px"></asp:TextBox><asp:CalendarExtender ID="Panel1CalendarExtender1" runat="server" PopupButtonID="Panel1imgPopup" TargetControlID="Panel1IncomingDateValue" Format="dd-MMMM-yyyy" CssClass="CalenderStyle" ></asp:CalendarExtender></td><td class="auto-style33"><asp:Label ID="Label4" runat="server" CssClass="auto-style34" Text="تاريخ الرسالة"></asp:Label></td><td></td></tr><tr align="center"><td align="center" colspan="5" class="auto-style22"><asp:Button ID="OKbtn" runat="server" BackColor="#6262FF" ForeColor="White" Height="38px"
style="text-align: center; font-size: 28px; font-family: sc_AMEEN;margin-top:25px; margin-bottom: 5px; -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Text="حفظ" Width="200px"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" /></td></tr></table> <table id="validationtable" runat="server" width="100%"><tr><td colspan="3" style="text-align: right" ><asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="auto-style35" DisplayMode="List" ForeColor="#CC0000" Height="62px" Width="483px" /></td></tr></table></asp:Panel>Its code-behind:
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Diagnostics
Partial Class NewPosting_IncomingPostInfo
Inherits System.Web.UI.Page
Public Shared IncomingDateStr As String
Public Shared UserName As String
Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If Session("UserName") = "" Then
Response.Redirect("~\Logon\LogonScreen.aspx")
End If
UserName = Session("username")
Dim querystring As String
If IsPostBack = False Then
Dim conString = ConfigurationManager.ConnectionStrings("TrackingConnectionString").ConnectionString
Using connection As New SqlConnection(conString)
connection.Open()
querystring = "SELECT IncomePostDate,IncomeRefNo FROM IncomingLetterInfo WHERE (LoadedByUserIndx=@Ix)"
Dim GetIncomingInfo As New SqlCommand(querystring, connection)
GetIncomingInfo.Parameters.Add("@Ix", SqlDbType.Int)
GetIncomingInfo.Parameters("@Ix").Value = TDClass.GetLoggingUserIndxValue(Session("username"))
Dim IncomingInfo As SqlDataReader = GetIncomingInfo.ExecuteReader
If IncomingInfo.HasRows Then
IncomingInfo.Read()
If IsDBNull(IncomingInfo(0)) = False Then
Dim IncomingDate As Date = IncomingInfo(0)
Panel1IncomingDateValue.Text = Format(IncomingDate, "dd-MMMM-yyyy")
End If
If IsDBNull(IncomingInfo(1)) = False Then
Panel1PostRefNo.Text = IncomingInfo(1)
End If
IncomingInfo.Close()
End If
End Using
End If
End Sub
Protected Sub OKbtn_Click(sender As Object, e As EventArgs) Handles OKbtn.Click
If Page.IsValid = True Then
Dim queryString As String
Dim conString = ConfigurationManager.ConnectionStrings("TrackingConnectionString").ConnectionString
Using connection As New SqlConnection(conString)
connection.Open()
queryString = "DELETE FROM IncomingLetterInfo WHERE (LoadedByUserIndx=@Ix)"
Dim RemoveOldIncomingLetterInfo As New SqlCommand(queryString, connection)
RemoveOldIncomingLetterInfo.Parameters.Add("@Ix", SqlDbType.Int)
RemoveOldIncomingLetterInfo.Parameters("@Ix").Value = TDClass.GetLoggingUserIndxValue(UserName)
RemoveOldIncomingLetterInfo.ExecuteNonQuery()
If Panel1IncomingDateValue.Text = "" And Panel1PostRefNo.Text = "" Then
GoTo Skipping
End If
'If Panel1IncomingDateValue.Text <> "" Then
' IncomingDateStr = Panel1IncomingDateValue.Text
'End If
If Panel1IncomingDateValue.Text <> "" And Panel1PostRefNo.Text <> "" Then
queryString = "INSERT INTO IncomingLetterInfo(IncomePostDate,IncomeRefNo,LoadedByUserIndx) VALUES(@PD,@Ref,@UI)"
Dim StoreIncomingInfo As New SqlCommand(queryString, connection)
StoreIncomingInfo.Parameters.Add("@PD", SqlDbType.Date)
StoreIncomingInfo.Parameters("@PD").Value = Date.Parse(Panel1IncomingDateValue.Text)
StoreIncomingInfo.Parameters.Add("@Ref", SqlDbType.NVarChar)
StoreIncomingInfo.Parameters("@Ref").Value = Panel1PostRefNo.Text
StoreIncomingInfo.Parameters.Add("@UI", SqlDbType.Int)
StoreIncomingInfo.Parameters("@UI").Value = TDClass.GetLoggingUserIndxValue(UserName)
StoreIncomingInfo.ExecuteNonQuery()
ElseIf Panel1IncomingDateValue.Text = "" And Panel1PostRefNo.Text <> "" Then
queryString = "INSERT INTO IncomingLetterInfo(IncomeRefNo,LoadedByUserIndx) VALUES(@Ref,@UI)"
Dim StoreIncomingInfo As New SqlCommand(queryString, connection)
StoreIncomingInfo.Parameters.Add("@Ref", SqlDbType.NVarChar)
StoreIncomingInfo.Parameters("@Ref").Value = Panel1PostRefNo.Text
StoreIncomingInfo.Parameters.Add("@UI", SqlDbType.Int)
StoreIncomingInfo.Parameters("@UI").Value = TDClass.GetLoggingUserIndxValue(UserName)
StoreIncomingInfo.ExecuteNonQuery()
ElseIf Panel1IncomingDateValue.Text <> "" And Panel1PostRefNo.Text = "" Then
queryString = "INSERT INTO IncomingLetterInfo(IncomePostDate,LoadedByUserIndx) VALUES(@PD,@UI)"
Dim StoreIncomingInfo As New SqlCommand(queryString, connection)
StoreIncomingInfo.Parameters.Add("@PD", SqlDbType.Date)
StoreIncomingInfo.Parameters("@PD").Value = Date.Parse(Panel1IncomingDateValue.Text)
StoreIncomingInfo.Parameters.Add("@UI", SqlDbType.Int)
StoreIncomingInfo.Parameters("@UI").Value = TDClass.GetLoggingUserIndxValue(UserName)
StoreIncomingInfo.ExecuteNonQuery()
End If
Skipping:
End Using
ScriptManager.RegisterStartupScript(Page, GetType(Page), "CloseWindow", "window.close();", True)
End If
End Sub
Protected Sub Panel1Cancel_Click(sender As Object, e As ImageClickEventArgs) Handles Panel1Cancel.Click
ScriptManager.RegisterStartupScript(Page, GetType(Page), "CloseWindow", "window.close();", True)
End Sub
Protected Sub IncomingDateValidator_ServerValidate(source As Object, args As ServerValidateEventArgs) Handles IncomingDateValidator.ServerValidate
If IsDate(Panel1IncomingDateValue.Text) = True Then
If DateDiff("d", Now(), Panel1IncomingDateValue.Text) > 0 Then
args.IsValid = False
End If
End If
End Sub
End ClassThe main form in which I want to put the modalpopupextender of the above panel
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPages/MyMasterPage.master" AutoEventWireup="false" CodeFile="NewLetterPosting.aspx.vb" Inherits="NewPosting_NewLetterPosting" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"><style type="text/css">
.MainFieldsDivStyle
{
border-color: Black;
width: 70%;
border-style: solid;
margin-top: 22px;
background-color:#C9DCF2;
opacity:0.8;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}
.ErrorMessage
{
color: red;
text-align: right;
font-style: normal;
font-size: 28px;
}
.FooterErrorMessage
{
color: red;
text-align: right;
font-family: sc_AMEEN;
font-style: normal;
font-size: 28px;
margin-left: 2px;
margin-right:40px;
}
.FileUploadStyle
{
direction:rtl;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}
.LabelingCell {
border: 1px solid Black;
background-color:#96C2F2;
width: 170px;
}
.ReserverIcon
{
margin-right:5px;
}
.ButtonoutA
{
cursor:default;
text-align:center;
}
.ButtonhoverA
{
cursor:pointer;
text-align:center;
}
.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;
}
#overlay
{
position: fixed;
z-index: 99;
top: 0px;
left: 0px;
background-color: #f8f8f8;
width: 100%;
height: 100%;
filter: Alpha(Opacity=90);
opacity: 0.9;
-moz-opacity: 0.9;
}
#theprogress
{
background-color: #fff;
border:1px none #ccc;
padding:10px;
width: 300px;
height: 30px;
line-height:30px;
text-align: center;
filter: Alpha(Opacity=100);
opacity: 1;
-moz-opacity: 1;
}
#modalprogress
{
position: absolute;
top: 40%;
left: 50%;
margin: -11px 0 0 -150px;
color: #990000;
font-weight:bold;
font-size:28px;
font-family:SC_AMEEN;
}
.auto-style3 {
color: red;
text-align: right;
font-style: normal;
font-size: 24px;
}
.Panel1Style
{
margin-top:30px;
background-color:#C9DCF2;
opacity: 0.8;
Border-Color:Black;
Border-Style:Solid;
Width:700px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
border-radius: 15px;
}
.modalBackground
{
background-color:black;
filter:alpha(opacity=90);
opacity:0.8;
}
</style></asp:Content><asp:Content ID="Content2" ContentPlaceHolderID="CpMainContent" Runat="Server"><script type="text/javascript">
function OpenCCTargets() {
window.open('CCPosting.aspx', '_blank')
}
function OpenTagsWindow() {
window.open('TagsWindow.aspx', '_blank')
}
function OpenMultiple() {
window.open('NewPostTargets.aspx', '_blank');
}
function SelectPrivatePersons() {
window.open('PrivacyPersons.aspx', '_blank');
}
function OpenIncomingInfo() {
window.open('IncomingPostInfo.aspx', '_blank');
}
function IsFileSelected() {
if (document.getElementById("<%=AttachmentsSelecter.ClientID%>").value == "") {
document.getElementById("<%=AttachmentsSelecter.ClientID%>").style.color = "Transparent";
document.getElementById("<%=AttachmentsSelecter.ClientID%>").style.backgroundColor = "White";
}
else {
document.getElementById("<%=AttachmentsSelecter.ClientID%>").style.color = "black";
document.getElementById("<%=AttachmentsSelecter.ClientID%>").style.backgroundColor = "Green";
}
}</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';
//});
//$.idleTimer(1000);</script><asp:toolkitscriptmanager ID="ScriptManager1" runat="server" /><asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate><div id="MainFields" runat="server" class="MainFieldsDivStyle" ><table id="NewPostingForm" runat="server" width="100%" ><tr style="height:60px;" align="center" ><td colspan="6"><asp:Label ID="Label6" runat="server" Font-Names="Sakkal Majalla" Height="42px" style="font-size: 38px; font-family: 'Sakkal Majalla';" Text="رســالة جديـــــدة"></asp:Label></td><td></td></tr><tr><td align="right" width="5%"><asp:CustomValidator ID="SenderNotUser" runat="server"
ControlToValidate="sourcename" CssClass="ErrorMessage"
ErrorMessage="إذا كانت المراسلة داخلية فالمرسل يجب أن يكون هو المستخدم نفسه" Width="12px">*</asp:CustomValidator><asp:CustomValidator ID="BothIdenticalValidator" CssClass="ErrorMessage"
runat="server" ErrorMessage="المرسل يجب أن يكون مختلفا عن المستقبل"
SetFocusOnError="True" Display="Dynamic" ControlToValidate="SourceName" Width="12px" >*</asp:CustomValidator></td><td width="5%"><asp:Button ID="PickFromExEntity" runat="server" CausesValidation="False" ForeColor="White" Height="38px"
Text="..." ToolTip="اضغط لاختيار الجهة الخارجية" UseSubmitBehavior="False" BackColor="#6262FF"
style="text-align: center; font-family: sc_AMEEN; font-size: 30px;" Width="35px"
onMouseOut="this.className='ButtonoutA'" onMouseOver="this.className='ButtonhoverA'" /></td><td align="right" colspan="3" width="55%" ><asp:DropDownList ID="SourceName" runat="server" DataSourceID="SDS2"
DataTextField="Name" DataValueField="Indx" Height="35px"
style="text-align:right ;font-family: 'Sakkal Majalla'; font-size: 24px; margin-top: 0px; margin-bottom: 0px; border-style:solid; border-color:Black; border-width:2px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px; "
Width="500px" BackColor="White" AutoPostBack="True"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" /></td><td align="right" class="LabelingCell" width="30%"><asp:Label ID="FromLabel" runat="server" Text="مــــــــن"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;" ></asp:Label></td><td width="5%"></td></tr><tr><td align="right" ><asp:CustomValidator ID="NoneUserValidator" runat="server"
ErrorMessage="المستخدم يجب أن يكون مرسلا أو مستقبلا"
ControlToValidate="TargetName" CssClass="ErrorMessage"
SetFocusOnError="True" Display="Dynamic">*</asp:CustomValidator><asp:CustomValidator ID="BothExternalValidator" runat="server"
ErrorMessage="المرسل أو المستقبل يجب أن يكون من داخل الوزارة"
ControlToValidate="TargetName" CssClass="ErrorMessage"
SetFocusOnError="True" Display="Dynamic">*</asp:CustomValidator></td><td><asp:Button ID="PickToExEntity" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="38px"
style="text-align: center; font-family: sc_AMEEN; font-size: 30px;" ToolTip="اضغط لاختيار الجهة الخارجية" UseSubmitBehavior="False" Width="35px"
onMouseOut="this.className='ButtonoutA'" onMouseOver="this.className='ButtonhoverA'" Text="..." /></td><td align="right" colspan="2" ><asp:DropDownList ID="TargetName" runat="server" DataSourceID="SDS1"
DataTextField="Name" DataValueField="Indx" Height="35px"
style="text-align:right ;font-family: 'Sakkal Majalla'; font-size: 24px; margin-top: 0px; margin-bottom: 0px; border-style:solid; border-color:Black;
border-width:2px;-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
Width="420px" BackColor="White" AutoPostBack="True"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" /></td><td align="right"><asp:radiobutton ID="AloneCB" AutoPostBack="True" runat="server" style="font-family: 'sakkal Majalla'; font-size: 24px;" Text="واحد" TextAlign="Left" Width="75px" Height="35px" /></td><td align="right" class="LabelingCell" rowspan="2"><asp:Label ID="ToLabel" runat="server" Text="إلـــــــى"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="30px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" ></asp:Label></td><td></td></tr><tr><td align="right" ><asp:CustomValidator ID="NoMultiTargetsSelected" runat="server"
ErrorMessage="عند اختيار "متعدد" فيجب إضافة مستلم أو أكثر في القائمة التي ستظهر بالضغط على الزر المقابل"
ControlToValidate="TargetName" CssClass="ErrorMessage"
SetFocusOnError="True" Display="Dynamic">*</asp:CustomValidator></td><td> </td><td align="right" colspan="2" ><asp:Button ID="OpenMultiTargets" runat="server" BackColor="#999999" AutoPostBack="true"
style="font-size: 30px; margin-left: 30px; font-family: sc_AMEEN; text-align: center;" Height="38px" ForeColor="White" Width="35px" CausesValidation="False" UseSubmitBehavior="False" OnClientClick="OpenMultiple()"
onMouseOver="this.className='ButtonhoverA'" onMouseOut="this.className='ButtonoutA'" Text="..." /></td><td align="right"><asp:radiobutton ID="MultiCB" AutoPostBack="True" runat="server" style="font-family: 'sakkal Majalla'; font-size: 24px" Text="متعدد" TextAlign="Left" Width="75px" Height="35px" /></td><td></td></tr><tr><td style="text-align: right" ><asp:CustomValidator ID="SavedDraftLetterID" runat="server" ControlToValidate="TargetName" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="يمكنك تغيير رقم الرسالة بعد حفظ مسودة الرسالة" SetFocusOnError="True">*</asp:CustomValidator></td><td><asp:Button ID="EditLetterID" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="38px"
onMouseOut="this.className='ButtonoutA'" onMouseOver="this.className='ButtonhoverA'"
style="font-size: 30px; text-align: left; font-family: sc_AMEEN;" ToolTip="اضغط لتغيير رقم الرسالة" UseSubmitBehavior="False" Width="35px" Text="..." /></td><td align="right" colspan="3"><asp:textbox ID="LetterIDTxtBox" runat="server" Height="35px"
style="font-family: 'sakkal Majalla'; font-size: 30px; text-align: center; margin-top: 0px; border-style:solid; border-color:Black;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
Width="495px" ForeColor="#0061C1" ReadOnly="True" ></asp:textbox></td><td align="right" class="LabelingCell"><asp:Label ID="LetterIDLabel" runat="server" Text="رقم الرسالة"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="30px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td style="text-align: right" ><asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="TargetName" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="يمكنك تغيير رقم الرسالة بعد حفظ مسودة الرسالة" SetFocusOnError="True">*</asp:CustomValidator></td><td><%--<asp:Button ID="EditFollowUpID" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="38px"
onMouseOut="this.className='ButtonoutA'" onMouseOver="this.className='ButtonhoverA'"
style="font-size: 30px; text-align: left; font-family: sc_AMEEN;" ToolTip="اضغط لتغيير رقم الرسالة" UseSubmitBehavior="False" Width="35px" Text="..." />--%></td><td align="right" colspan="3"><asp:textbox ID="FollowUpID" runat="server" Height="35px"
style="font-family: 'sakkal Majalla'; font-size: 30px; text-align: center; margin-top: 0px; border-style:solid; border-color:Black;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
Width="495px" ForeColor="#0061C1" ReadOnly="True" ></asp:textbox></td><td align="right" class="LabelingCell"><asp:Label ID="Label7" runat="server" Text="رقم المتابعة"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="30px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td align="right" ><asp:RequiredFieldValidator ID="SubjectRequiredValidator" runat="server"
ErrorMessage="لم تقم بإدخال الموضوع" ControlToValidate="SubjectTxtBox"
CssClass="ErrorMessage" SetFocusOnError="True" Display="Dynamic">*</asp:RequiredFieldValidator></td><td></td><td align="right" colspan="3"><asp:textbox ID="SubjectTxtBox" runat="server" Height="35px"
style="font-family: 'Sakkal Majalla'; font-size: 22px; text-align: right; margin-top: 0px; border-style:solid; border-color:Black;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Width="495px"></asp:textbox></td><td align="right" class="LabelingCell"><asp:Label ID="SubjectLabel" runat="server" Text="الموضــوع"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td></td><td></td><td align="right" colspan="3"><asp:TextBox ID="CommentsTxtBox" runat="server" TextMode="MultiLine" Height="100px"
Width="490px" BorderColor="Black" BorderStyle="Solid" BorderWidth="2px"
Style="font-size: 22px; font-family: 'Sakkal Majalla'; text-align: right;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"></asp:TextBox></td><td align="right" class="LabelingCell"><asp:Label ID="CommentsLabel" runat="server" Text="التعليق / الملاحظات"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="74px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" ></asp:Label></td><td></td></tr><tr style="height:40px;"><td></td><td align="right"></td><td align="right" colspan="2"></td><td align="right"><asp:radiobutton ID="NowDate" runat="server" AutoPostBack="True" Height="35px" style="font-family: 'sakkal Majalla'; font-size: 24px;" Text="الآن" TextAlign="Left" /></td><td align="right" class="LabelingCell" rowspan="2"><asp:Label ID="Label5" runat="server" Text="تاريخ الرسالة"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="30px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td align="right" ><asp:CustomValidator ID="NowToPostDateValidator" runat="server"
ErrorMessage="تاريخ الرسالة يجب أن لا يكون أكبر من تاريخ اليوم"
ControlToValidate="TargetName" CssClass="ErrorMessage"
SetFocusOnError="True" Display="Dynamic" Width="12px">*</asp:CustomValidator></td><td></td><td align="right" width="250px" ><asp:ImageButton ID="imgPopup" runat="server" Height="30px" ImageAlign="Bottom" ImageUrl="~/Images/Calender.png" Width="26px" CausesValidation="False" /></td><td align="right"><asp:TextBox ID="PostDateTxtBox" runat="server" Height="32px" style="border:solid black 2px; font-family: 'sakkal Majalla'; font-size: 24px; text-align: right;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Width="165px"></asp:TextBox><asp:CalendarExtender ID="Calendar1" runat="server" Format="dd-MMMM-yyyy" PopupButtonID="imgPopup" TargetControlID="PostDateTxtBox"></asp:CalendarExtender></td><td align="right"><asp:radiobutton ID="OtherDate" AutoPostBack="True" runat="server" style="font-family: 'sakkal Majalla'; font-size: 24px" Text="آخـــــــر" TextAlign="Left" Width="75px" Height="35px" /></td><td></td></tr><tr><td align="right" ><asp:CustomValidator ID="NoRequestMultiTargets" CssClass="ErrorMessage"
SetFocusOnError="true" runat="server" Display="Dynamic"
ControlToValidate="RAPTmpTxt" ErrorMessage="إذا كان نوع الرسالة "طلب" فإن المرسل إليه يجب أن يكون واحد و ليس متعدد" Width="12px">*</asp:CustomValidator></td><td></td><td align="right" colspan="3"><asp:DropDownList ID="PostTypeDDL" runat="server" Height="35px"
style="text-align:right ;font-family: 'sakkal Majalla'; margin-top:0px;font-size: 24px; text-align: right; border-style:solid; border-color:Black; border-width:2px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
Width="120px" DataSourceID="SDS4" DataTextField="PostType" DataValueField="PostType" AutoPostBack="True"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'"></asp:DropDownList> </td><td align="right" class="LabelingCell"><asp:Label ID="PTypeLabel" runat="server" Text="نوع الرسالة"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td align="right"><asp:RegularExpressionValidator ID="RAPValidator" runat="server" ControlToValidate="RAPTxtBox" Display="Dynamic" ErrorMessage="مهلة الرد غير صحيحة" SetFocusOnError="True" style="font-size: 26px" ValidationExpression="^[0-9]+$" Width="12px">*</asp:RegularExpressionValidator><%--<asp:CustomValidator ID="RAPCustomeValidator" CssClass="ErrorMessage"
SetFocusOnError="true" runat="server" Display="Dynamic"
ControlToValidate="RAPTmpTxt" ErrorMessage="لم تقم بإدخال مهلة الرد">*</asp:CustomValidator>--%></td><td></td><td align="right" colspan="3"><asp:textbox ID="RAPTxtBox" runat="server" Height="30px"
style="font-family: verdana, Geneva, Tahoma, sans-serif; margin-top:0px; font-size: 22px; text-align: center; border-style:solid; border-color:Black;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
Width="115px"></asp:textbox></td><td align="right" class="LabelingCell"><asp:Label ID="RAPLabel" runat="server" Text="مهلة الرد - يوم"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td ></td><td></td><td align="right" colspan="3" ><asp:DropDownList ID="ImportanceDD" runat="server" Height="35px"
style="text-align:right;font-family: 'sakkal Majalla';margin-top:0px; font-size: 24px; text-align: right; border-style:solid; border-color:Black;border-width:2px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
Width="120px" DataSourceID="SDS3" DataTextField="Importance" DataValueField="Importance"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'"></asp:DropDownList></td><td align="right" class="LabelingCell"><asp:Label ID="Label1" runat="server" Text="الأهمية"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;"
BorderColor="Black" Width="110px" ></asp:Label></td><td></td></tr><tr><td align="right" ><%--<asp:RequiredFieldValidator ID="AttachmentRequired" runat="server" ControlToValidate="AttachmentsSelecter" CssClass="auto-style2" Display="Dynamic" ErrorMessage="لم تقم باختيار الملف المرفق" SetFocusOnError="True">*</asp:RequiredFieldValidator>--%><asp:CustomValidator ID="AttachmentFilesCount" runat="server" SetFocusOnError="true"
display="Dynamic" CssClass="auto-style3"
ErrorMessage="عدد الملفات المرفقة يجب أن لا يتجاوز خمسة ملفات">*</asp:CustomValidator><asp:CustomValidator ID="AttachmentRequiredFile" runat="server"
ErrorMessage="لم تقم باختيار أي ملف مرفق"
CssClass="auto-style3" SetFocusOnError="true" Display="Dynamic">*</asp:CustomValidator><asp:CustomValidator ID="AttachmentFileType" runat="server"
ErrorMessage="نوع إحدى المرفقات التي قمت باختيارها غير صحيح" OnServerValidate="AttachmentValidator1"
CssClass="auto-style3" SetFocusOnError="True" Display="Dynamic">*</asp:CustomValidator></td><td></td><td align="right" colspan="3"><asp:FileUpload ID="AttachmentsSelecter" runat="server" onchange="IsFileSelected()"
Width="495px" BorderColor="Black" BorderStyle="Solid"
Height="35px" BackColor="White" BorderWidth="2px"
style="font-size: 22px; font-family: 'sakkal Majalla';
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;"
cssclass="FileUploadStyle" AllowMultiple="True" /><br /><asp:TextBox ID="RAPTmpTxt" runat="server" Visible="False" Width="1px">Scratch</asp:TextBox><asp:TextBox ID="TmpTxt" runat="server" Visible="False" Width="1px">Scratch</asp:TextBox></td><td align="right" class="LabelingCell" ><asp:Label ID="AttachmentLabel" runat="server" Text="المرفقات"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: right;" Width="110px" ></asp:Label></td><td></td></tr><tr><td align="right" ><asp:CustomValidator ID="IncomingInfoValidator" runat="server" ControlToValidate="TargetName" CssClass="ErrorMessage" Display="Dynamic" SetFocusOnError="True" ErrorMessage="معلومات المرجع والتاريخ المرافق يجب أن تكون فارغة لأن المرسل من داخل الوزارة" Width="12px">*</asp:CustomValidator></td><td></td><td align="right" colspan="3"><asp:Button ID="OpenIncomingInfoWindow" runat="server" BackColor="#6262FF" style="font-size: 30px; text-align: center; font-family: sc_AMEEN;" Height="35px" ForeColor="White" CausesValidation="False" Width="35px" OnClientClick="OpenIncomingInfo()" UseSubmitBehavior="False"
onMouseOver="this.className='ButtonhoverA'" onMouseOut="this.className='ButtonoutA'" Text="..." /></td><td align="right" class="LabelingCell" ><asp:Label ID="Label4" runat="server" BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px" style="font-size: 26px; font-family: sc_AMEEN;" Text="المرجع والتاريخ المرافق"></asp:Label></td><td></td></tr><tr><td></td><td></td><td align="right" colspan="3" ><asp:Button ID="OpenTagsWindow" runat="server" BackColor="#6262FF" style="font-size: 30px; text-align: center; font-family: sc_AMEEN;" Height="35px" ForeColor="White" CausesValidation="False" Width="35px" OnClientClick="OpenTagsWindow()" UseSubmitBehavior="False"
onMouseOver="this.className='ButtonhoverA'" onMouseOut="this.className='ButtonoutA'" Text="..." /></td><td align="right" class="LabelingCell"><asp:Label ID="Label2" runat="server" Text="الكلمات المفتاحية"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: center;" ></asp:Label></td><td></td></tr><tr><td align="right" ><asp:CustomValidator ID="SenderAndCCTargetExternalEntities" runat="server" ControlToValidate="TargetName" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="لا يمكن إرسال نسخة إلى جهة خارج الوزارة عندما يكون المرسل من خارح الوزارة أيضا" SetFocusOnError="True" Width="12px">*</asp:CustomValidator></td><td></td><td align="right" colspan="3" ><asp:Button ID="OpenCCWindow" runat="server" BackColor="#6262FF" style="font-size: 30px; text-align: center; font-family: sc_AMEEN;" Height="35px" ForeColor="White" CausesValidation="False" Width="35px" OnClientClick="OpenCCTargets()" UseSubmitBehavior="False"
onMouseOver="this.className='ButtonhoverA'" onMouseOut="this.className='ButtonoutA'" Text="..." /></td><td align="right" class="LabelingCell" ><asp:Label ID="CCPosting" runat="server" Text="إرسال نسخة"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: center;" ></asp:Label></td><td></td></tr><tr><td align="right" ><asp:CustomValidator ID="PrivacyMessageValidator" runat="server" ControlToValidate="TargetName" CssClass="ErrorMessage" Display="Dynamic" ErrorMessage="يجب اختيار الأشخاص المخولين للإطلاع على الرسالة لأنها سرية" SetFocusOnError="True" Width="12px">*</asp:CustomValidator></td><td></td><td align="right" colspan="2"><asp:CheckBox ID="IsTopSecret" runat="server" Height="36px" style="font-family: 'sakkal Majalla'; font-size: 24px; color: #0000CC;" Text="هذه الرسالة خاصة وسرية" TextAlign="Left" /></td><td align="right"><asp:Button ID="PrivateUsers" runat="server" BackColor="#6262FF" CausesValidation="False" ForeColor="White" Height="35px" OnClientClick="SelectPrivatePersons()" style="font-size: 30px; text-align: center; font-family: sc_AMEEN;" UseSubmitBehavior="False" Width="35px"
onMouseOver="this.className='ButtonhoverA'" onMouseOut="this.className='ButtonoutA'" Text="..." /></td><td align="right" class="LabelingCell"><asp:Label ID="Label3" runat="server" Text="الخصوصية"
BorderStyle="None" BorderWidth="0px" ForeColor="Black" Height="35px"
style="font-size: 30px; margin-right:5px; font-family: sc_AMEEN; text-align: center;" ></asp:Label></td><td></td></tr><tr align="center" ><td colspan="7"><asp:Button ID="OpenDraft" runat="server" BackColor="#6262FF" ForeColor="White" Height="40px" style="text-align: center; font-size: 30px; margin-top: 46px; margin-bottom: 5px; font-family: sc_AMEEN; margin-left: 11px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Text="اختيار المسودة" Width="200px" CausesValidation="False" UseSubmitBehavior="False"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" /><asp:Button ID="SaveAsDraft" runat="server" BackColor="#6262FF" ForeColor="White" Height="40px" style="text-align: center; font-size: 30px; margin-top: 46px; margin-bottom: 5px; font-family: sc_AMEEN; margin-left: 44px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Text="حفظ المسودة" Width="200px" UseSubmitBehavior="False"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" /><asp:Button ID="PostNewLetter" runat="server" BackColor="#6262FF" ForeColor="White" Height="40px" style="text-align: center; font-size: 30px; margin-top: 46px; margin-bottom: 5px; font-family: sc_AMEEN; margin-left: 44px;
-moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px; " Text="أرسـل" Width="200px"
onMouseOver="this.className='Buttonhover'" onMouseOut="this.className='Buttonout'" UseSubmitBehavior="False" /></td></tr><tr><td colspan="7" align="left" style="height:50px;" ><asp:ImageButton ID="CloseThisPage" runat="server" Height="40px" ImageUrl="~/Images/CloseThisPage.png" onMouseOut="this.className='Buttonout'" onMouseOver="this.className='Buttonhover'" style="margin-left: 1px; margin-top: 30px;" Width="50px" CausesValidation="False" /></td></tr></table> <table id="ValidationSummaryTable" runat="server" width="98%"> <tr><td rowspan="5" align="right"><asp:ValidationSummary ID="ValidationSummary1" runat="server"
CssClass="FooterErrorMessage" DisplayMode="List"
Height="144px" /></td></tr></table> </div></ContentTemplate> <Triggers><asp:PostBackTrigger ControlID="PostNewLetter" /> </Triggers></asp:UpdatePanel> <asp:UpdateProgress ID="prgLoadingStatus" runat="server" DynamicLayout="true"><ProgressTemplate><div id="overlay"><div id="modalprogress"><div id="theprogress"><asp:Image ID="imgWaitIcon" runat="server" ImageAlign="AbsMiddle" ImageUrl="~/images/WaitingImage.gif" Height="100px" Width="100px" /><br />الرجاء الانتظار
</div></div></div></ProgressTemplate></asp:UpdateProgress> The button that I want to use to fire the Panel1 is the button "OpenIncomingInfoWindow"button. So how to deal with the validation problem of the panel1 when use this panel as modalpopup ?