Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hai..
I
am having an issue in validating popup screen in my project.I am using validation group to validate the controls in popup .Our project standard is showing Red Foreground for controls which are not filled.But it not working in popups ?Is any way to solve this?

XML
<tr>
                    <td width="10%"></td>
                    <td width="25%">
                        <asp:Label ID="lblMandantCode" runat="server" Text="Mandant Code"  ></asp:Label>
                    </td>
                    <td colspan="3">
                        <asp:TextBox ID="txtMandantCode" runat="server" class="txtBox"  Width="200px" TextMode="SingleLine"  MaxLength="3"></asp:TextBox>
                    </td>
                     <td >
                    <asp:RequiredFieldValidator ID="RVMandantCode" runat="server" ErrorMessage="*" ControlToValidate="txtMandantCode"
                           ForeColor="Red" ValidationGroup="V2"  Font-Bold ="true" Font-Size ="20" ></asp:RequiredFieldValidator>

                    </td>
 </tr>



<tr>
                 <td width="10%"></td>
                    <td width="25%">
                    </td>
                    <td colspan="3">
                       &nbsp; <asp:Button ID="btnExpClose" runat="server" Text="Close" class="btnNew"/>
                       &nbsp;
                        <asp:Button ID="btnExport" runat="server" ValidationGroup="V2" style="margin-bottom: 0px " Text="Export" class="btnNew" OnClick="btnExport_Click" />
                    </td>
</tr>
Posted
Comments
Laiju k 3-Nov-14 23:41pm    
how are you making popup on this
Er. Puneet Goel 3-Nov-14 23:51pm    
Post full details like the Code for Popup, Validation etc.
jithesh a 4-Nov-14 0:49am    
wHILE CLICKING ON 'btnExportLE ' popup will show

<asp:Button ID="btnExportLE" runat="server" class="btnNew" Text="Export LE"
OnClientClick="return ShowExpPopup();" />



function ShowExpPopup()
{
document.getElementById('<%= dvExpPopUp.ClientID %>').style.display = "block";
document.getElementById("divBG").style.display = "block";
return false;
}




<div id="dvExpPopUp" runat="server" class ="popups" style="display:none">
</div>
<table width="550px" style="font: Arial; font-size: small;">
<tr>
<td width="10%"></td>
<td width="25%">
<asp:Label ID="lblMandantCode" runat="server" Text="Mandant Code" >
</td>
<td colspan="3">
<asp:TextBox ID="txtMandantCode" runat="server" class="txtBox" Width="200px" TextMode="SingleLine" MaxLength="3">
</td>
<td >
<asp:RequiredFieldValidator ID="RVMandantCode" runat="server" ErrorMessage="*" ControlToValidate="txtMandantCode"
ForeColor="Red" ValidationGroup="V2" Font-Bold ="true" Font-Size ="20" >

</td>
</tr>

<tr>
<td width="10%"></td>
<td width="25%">
<asp:Label ID="lblCriteria" runat="server" Text="Criteria">
</td>
<td id ="styled-select" colspan="3">
<select id="ddlCriteria" class="dropdown" >
<option value="All">All</option>
<option value="Period">Period</option>
</select>
</td>
</tr>
<tr id="Period" style="display: none;">
<td width="10%"></td>
<td width="25%" style="text-align:right;">
<asp:Label ID="lblFrom" runat="server" Text="From">
</td>
<td colspan="3">

<asp:TextBox ID="txtFrom" class="txtBox" Width="80px" runat="server">
<asp:CalendarExtender ID="CalendarExtender3" OnClientDateSelectionChanged="onstartDateChanged" TargetControlID="txtFrom" runat="server"
Format="dd/MM/yyyy" />
 
<asp:Label ID="lblTo" runat="server" Text="To">
<asp:TextBox ID="txtTo" class="txtBox" Width="80px" runat="server" >
<asp:CalendarExtender ID="CalendarExtender4" OnClientDateSelectionChanged="onEndDateChanged" TargetControlID="txtTo" runat="server"
Animated="True" Format="dd/MM/yyyy" />
</td>
</tr>

<tr>
<td width="10%"></td>
<td width="25%">
</td>
<td colspan="3">
         
<asp:Label ID="lblResult" runat="server" Text="" Font-Bold ="true" ForeColor ="Green">
</td>
</tr>
<tr>
<td width="10%"></td>

<td colspan="3">

</td>
</tr>
<tr>
<td width="10
jithesh a 4-Nov-14 0:50am    
"></td>
<td width="25%">
</td>
<td colspan="3">
         
<asp:Label ID="lblResult" runat="server" Text="" Font-Bold ="true" ForeColor ="Green">
</td>
</tr>
<tr>
<td width="10%"></td>

<td colspan="3">

</td>
</tr>
<tr>
<td width="10%"></td>
<td width="25%">
</td>
<td colspan="3">
  <asp:Button ID="btnExpClose" runat="server" Text="Close" class="btnNew"/>
 
<asp:Button ID="btnExport" runat="server" ValidationGroup="V2" style="margin-bottom: 0px " Text="Export" class="btnNew" OnClick="btnExport_Click" />
</td>
</tr>
</table>
</div>
KaushalJB 4-Nov-14 5:59am    
First of all your <div> gets end soon after starting. Secondly try using UpdatePanel and then check. You can also use jQuery which is the simplest way for Validation of any controls... http://www.aspdotnet-suresh.com/2013/10/jquery-validate-registration-form-before-submit.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900