Blank Page after removing Required Field Validator

Last post 04-28-2008 7:33 AM by informaniac. 10 replies.

Sort Posts:

  • Blank Page after removing Required Field Validator

    04-24-2008, 5:04 AM

    Hi,

    I'm using ASP.Net 2.0 with C#.

     I'm facing a unique problem.

     
    I had placed a validation summary and a required field validator.

    Now I removed the validation summary control.

    The page still works fine.

    But If I'm removing the required field validator then the page just display a white blank screen.

    I viewed the source and in that all the control and the html markup is proper and in place.

    What could be problem here?

     
    Thanks in advance.
     

  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 5:25 AM
    • Loading...
    • rajesh8880
    • Joined on 08-23-2007, 11:30 AM
    • India
    • Posts 96

     hi

    pls post your code for clarification

     

    Regards
    Rajesh
  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 5:29 AM

    Maybe you did something in codebehind and forgot about it.

    Best regards,
    Denis Chiochiu

    ---------------------------------
    If you found this useful, please mark it as an answer. Thank you.
  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 5:30 AM

    U want the entire code?

    Below is the code that is causing problem.

    PREVIOUS 

    <asp:TextBox ID="txtPageSize" CssClass="flattxt" Width="32px" MaxLength="3" Columns="50"
    Height="16px" onfocus="curTxtID=this.id" onkeypress="javascript:return IntegerNumber();" runat="server"></asp:TextBox>
    <asp:RequiredFieldValidator ID="rfvPageSize"   runat="server" ControlToValidate="txtPageSize"></asp:RequiredFieldValidator>

    --Works fine

     AFTER REMOVING

    <asp:TextBox ID="txtPageSize" CssClass="flattxt" Width="32px" MaxLength="3" Columns="50" Height="16px" onfocus="curTxtID=this.id" onkeypress="javascript:return IntegerNumber();" runat="server"></asp:TextBox>

     -- This just displays the blank page.

    If you want me to display the entire page then plz tell me. 



     

  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 5:40 AM

     Nothing that I can see

  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 5:45 AM
    • Loading...
    • rajesh8880
    • Joined on 08-23-2007, 11:30 AM
    • India
    • Posts 96

    hi

    sorry ya. for me it works. a textbox is displayed after removing the validator.... 

    Regards
    Rajesh
  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 5:54 AM

     <html>
    <head id="Head1" runat="server">
        <title>MstOptions</title>
        <link href="../ExternalResources/Styles/Telesales_Styles.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <form id="frmAddEditState" runat="server">
            <div id="dvmst" runat="server">
                <table id="Table1" style="height: 96%" cellspacing="0" cellpadding="0" width="100%"
                    border="0">
                    <tr>
                        <td valign="top" align="center">
                            <table cellspacing="0" cellpadding="0" width="600" border="0">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="background-color: #ffffff">
                                        <table id="Table4" cellspacing="0" cellpadding="0" width="600" border="0">
                                            <tr>
                                                <td style="background-color: #990000">
                                                    <table id="Table5" cellspacing="1" cellpadding="1" width="100%" border="0">
                                                        <tr>
                                                            <td style="background-color: #ffffff">
                                                                <table id="Table7" cellspacing="0" cellpadding="0" width="100%" border="0">
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td valign="top">
                                                                            <table id="Table8" cellspacing="1" cellpadding="1" width="90%" style="background-color: #dddddd"
                                                                                border="0">
                                                                                <tr align="center">
                                                                                    <td class="whitebigtxt" style="background-color: #993300; height: 24px" colspan="2">
                                                                                        <b>
                                                                                            <asp:Label ID="lblModeMessage" runat="server"></asp:Label>Options</b></td>
                                                                                </tr>
                                                                                <tr style="background-color: #ffffff">
                                                                                    <td valign="top" align="right" colspan="2">
                                                                                        <span class="error">* denotes mandatory fields</span>
                                                                                    </td>
                                                                                </tr>
                                                                                <tr style="background-color: #ffffff">
                                                                                    <td colspan="2">
                                                                                        <asp:ValidationSummary ID="vsPageSize" runat="server" CssClass="error" />
                                                                                        <asp:Label ID="lblError" runat="server" CssClass="error"></asp:Label></td>
                                                                                </tr>
                                                                                <tr valign="middle">
                                                                                    <td class="error" style="background-color: #efefef; width: 50%; height: 24">
                                                                                        <span class="boldtext">&nbsp;&nbsp; Grid Size (Records/Page)</span>&nbsp; <span class="error">
                                                                                            &nbsp;*</span>
                                                                                    </td>
                                                                                    <td style="background-color: #ffffff; height: 24; width: 50%" align="left">
                                                                                        &nbsp;
                                                                                        <asp:TextBox ID="txtPageSize" CssClass="flattxt" Width="32px" MaxLength="3" Columns="50"
                                                                                            Height="16px" runat="server"></asp:TextBox>
                                                                                          <asp:RequiredFieldValidator ID="rfvPageSize"   runat="server" ControlToValidate="txtPageSize" ErrorMessage="Enter a page size" Display="none"></asp:RequiredFieldValidator>
                                                                                          <asp:RangeValidator ID="rgPageSize" runat="server" ControlToValidate="txtPageSize" MinimumValue="1" MaximumValue="500" Type="Integer" ErrorMessage="Invalid Page size" Display="none">
                                                                                          </asp:RangeValidator>
                                                                                          
                                                                                    </td>
                                                                                </tr>
                                                                                <tr valign="middle">
                                                                                    <td class="boldtext" style="background-color: #ffffff; height: 24" colspan="2">
                                                                                        <br />
                                                                                        <table id="Table9" cellspacing="0" cellpadding="0" width="100%" border="0">
                                                                                            <tr valign="top">
                                                                                                <td style="width: 50%; height: 0" align="right">
                                                                                                    <asp:Button ID="btnSave" CssClass="flatbtn" runat="server" Text="Save" OnClick="btnSave_Click">
                                                                                                    </asp:Button>&nbsp;<br />
                                                                                                </td>
                                                                                                <td style="width: 61%; height: 0" align="left">
                                                                                                    &nbsp;
                                                                                                    <asp:Button ID="btnCancel" CssClass="flatbtn" runat="server" Text="Cancel" CausesValidation="False"
                                                                                                        Width="48px" OnClick="btnCancel_Click"></asp:Button></td>
                                                                                            </tr>
                                                                                        </table>
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                    </tr>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;</td>
                                                                    </tr>
                                                                </table>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </body>
    </html>

  • Re: Blank Page after removing Required Field Validator

    04-24-2008, 6:03 AM
    • Loading...
    • rajesh8880
    • Joined on 08-23-2007, 11:30 AM
    • India
    • Posts 96

     hi

    i am very sorry. its working perfect. this is the code i used. First i commented the requiredfield validator. then i commented both the validators. all worked fine.

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm4.aspx.cs" Inherits="TestWeb.WebForm4" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html>
    <head id="Head1" runat="server">
        <title>MstOptions</title>
        <link href="../ExternalResources/Styles/Telesales_Styles.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
        <form id="frmAddEditState" runat="server">
            <div id="dvmst" runat="server">
                <table id="Table1" style="height: 96%" cellspacing="0" cellpadding="0" width="100%"
                    border="0">
                    <tr>
                        <td valign="top" align="center">
                            <table cellspacing="0" cellpadding="0" width="600" border="0">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="background-color: #ffffff">
                                        <table id="Table4" cellspacing="0" cellpadding="0" width="600" border="0">
                                            <tr>
                                                <td style="background-color: #990000">
                                                    <table id="Table5" cellspacing="1" cellpadding="1" width="100%" border="0">
                                                        <tr>
                                                            <td style="background-color: #ffffff">
                                                                <table id="Table7" cellspacing="0" cellpadding="0" width="100%" border="0">
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;
                                                                        </td>
                                                                    </tr>
                                                                    <tr>
                                                                        <td valign="top">
                                                                            <table id="Table8" cellspacing="1" cellpadding="1" width="90%" style="background-color: #dddddd"
                                                                                border="0">
                                                                                <tr align="center">
                                                                                    <td class="whitebigtxt" style="background-color: #993300; height: 24px" colspan="2">
                                                                                        <b>
                   &