Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4617268
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:06:02+00:00 2026-05-22T02:06:02+00:00

I have an ASP.NET 3.5 form with several fields and a sub form inside

  • 0

I have an ASP.NET 3.5 form with several fields and a sub form inside a ModalPopup. The problem I’m having is with a RequiredFieldValidator inside the ModalPopup. For some reason it is preventing post back inside the ModalPopup. Both the validator and the submit buttons have the same ValidationGroup that is unique to them. Here is the markup for the sub form:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="RoomBuilder.ascx.cs" Inherits="Admin_Controls_RoomBuilder" %>
<link href="../../../../style/FlexStyle.css" rel="stylesheet" type="text/css" id="style"
    runat="server" visible="false" />
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <div class="form" style="width: 420px; height: 500px; padding: 3px; position: relative;
            text-align: center;">
            <div style="width: 280px">
                <div class="item smalltitle ">
                    Title:

                </div>
                <div class="item">
                    <asp:TextBox ID="txtTitle" runat="server" Width="250px"></asp:TextBox>
                </div>
                <div class="item smalltitle gapontop">
                    Description:
                </div>
                <div class="item">
                    <asp:TextBox ID="txtDesc" runat="server" Width="250px" Height="40px" TextMode="MultiLine"></asp:TextBox>
                </div>
                <div class="item gapontop">
                    <div class="smalltitle floatLeft" style="width: 120px;">
                        Room Number
                    </div>
                    <div class="smalltitle floatLeft" style="width: 120px;">
                        Phone
                    </div>
                </div>
                <div class="item">
                    <div class="floatLeft" style="width: 120px;">
                        <asp:TextBox ID="txtRoomNo" runat="server" Width="100px"></asp:TextBox>
                    </div>
                    <div class="floatLeft" style="width: 120px;">
                        <asp:TextBox ID="txtPhone" runat="server" Width="100px"></asp:TextBox>
                    </div>
                </div>
                <div class="item smalltitle gapontop ">
                    Type:
                </div>
                <div class="item">
                    <asp:TextBox ID="txtType" runat="server" Width="250px"></asp:TextBox>
                </div>
                <div class="item smalltitle gapontop ">
                    Number of Seats:
                    <asp:RequiredFieldValidator ID="RequiredFieldValidatortxtNoSeats" runat="server" ErrorMessage="*" 
                        ControlToValidate="txtNoSeats" ValidationGroup="roomVal"></asp:RequiredFieldValidator>
                </div>
                <div class="item">
                    <asp:TextBox ID="txtNoSeats" runat="server" Width="50px"></asp:TextBox>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Not a number"
                        ControlToValidate="txtNoSeats" ValidationGroup="roomVal" ValidationExpression="[0-9]*"></asp:RegularExpressionValidator>
                </div>
            </div>            
            <!-- ************************************ -->
            <div class="topBorder" style="width: 100%; height: 35px; position: absolute; bottom: -8px;
                right: 2px; text-align: right; padding-top: 11px;">
                <asp:Button ID="btnCancel" runat="server" CssClass="button" Text="Cancel" CausesValidation="false"
                    OnClick="btnCancel_Click" ValidationGroup="roomVal" />
                <asp:Button ID="btnSave" runat="server" CssClass="button" Text="Save" OnClick="btnSave_Click" CausesValidation="true" ValidationGroup="roomVal" />
            </div>
        </div>
    </ContentTemplate>
</asp:UpdatePanel>

When the validator is removed (or CausesValidation is set to false), the sub form posts. RegularExpressionValidators don’t have this problem. I’ve run FireBug, but I’m not seeing any obvious errors.

Is there something I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:06:02+00:00Added an answer on May 22, 2026 at 2:06 am

    Oh my god I’m so stupid!! >:(

    Found the reason for the problem. There was another copy of the same control nested inside another control. And (of course) having the same ValidationGroup name as my first control all Required Field Validators fail to work!

    Argh! Candidate for a Daily WTF!

    Sorry to have wasted everybody’s time 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a complex asp.net form,having even 50 to 60 fields in one form
I have asp.net form that contains fields. When I access this window, my javascript
I have an asp.net text form that contains numerous decimal fields that are optional.
On one of my ASP.NET pages I have several asp:textbox fields. On this page
I have an ASP.NET web form that has a container usercontrol that hosts several
I have several text boxes in an ASP.NET Web Form. I want to ensure
I have an ASP.Net form and i would like to save it into a
For example, I have an ASP.NET form that is called by another aspx: string
Using web forms I know that you can only have one ASP.NET form on
I have an ASP.NET web form which I am adding a variable number User

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.