locked
TabContainer Advice RRS feed

  • Question

  • User-723833757 posted

    I am using an TabContainer inside an update panel, I have 6-7 tabs, each one contains customer data that can be edited in a ModalPopup

    I just have a question if i am doing this right.

    Should I have the whole TabContainer inside One Update Panel?

    Should I instead have an UpdatePanel inside each Tab?

    The issue I am having is validation inside a modalpopup, validation works fine, but modalpopup hides even if validation is wrong, and i want it to stay open if a required field is not entered. i am wondering if my setup has it not working correctly.

    So each tab has modalpopup for content in that tab.

    Just some advice on better practical programming

    				<ajx:TabPanel runat="server" ID="TabPanelContract" HeaderText="CONTRACT &#xf0d7;">
    					<ContentTemplate>
    						<div class="tab-body-container">
    							<div class="data-filter-by">
    								<span class="title bold">Service Contract</span>
    								<asp:Label ID="Label5" runat="server" Text=": All" />
    								<asp:LinkButton ID="LinkButton9" runat="server" PostBackUrl="~/Admin/Customers/account-create.aspx" Text="&#xf055;" CssClass="fa-2x" />
    								<asp:LinkButton runat="server" ID="LinkButton10" Text="&#xf021;" CssClass="fa-2x" />
    							</div>
    							<div class="data-group">
    								<span>Lock Box Code:</span>
    								<asp:Label ID="Label11" runat="server" CssClass="label" Text="No Data" />
    								<asp:LinkButton ID="LinkButton23" runat="server" CausesValidation="False" CssClass="fa-lg" Text="&#xf044;" />
    								<ajx:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="BtnEditLockBoxCode" OkControlID="BtnUpdateLockBoxCode" CancelControlID="BtnCancelUpdateLockBoxCode" PopupControlID="PnlEditLockBoxCode" ValidateRequestMode="Enabled" />
    								<asp:Panel ID="Panel1" runat="server" CssClass="ui-form popup">
    									<h1>Update Lock Box Code</h1>
    									<div class="form-group">
    										<span>Enter New Lock Box Code</span>
    										<asp:TextBox ID="TextBox4" runat="server" ValidationGroup="VgLockBoxCode" />
    										<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="UiLockBoxCode" ValidationGroup="VgLockBoxCode" />
    									</div>
    									<div class="button-group">
    										<asp:Button ID="Button1" runat="server" Text="&#xf0c7; Save" ValidationGroup="VgLockBoxCode" CausesValidation="true" />
    										<asp:Button ID="Button2" runat="server" Text="&#xf00d; Cancel" />
    									</div>
    
    								</asp:Panel>
    							</div>
    
    						</div>
    					</ContentTemplate>
    				</ajx:TabPanel>

    The reason I ask is I saw a post that if you don't want an modalpopup to close, you put an update panel in it

    Monday, August 24, 2015 6:46 PM

All replies

  • User1724605321 posted

    Hi Bobby ,

    The issue I am having is validation inside a modalpopup, validation works fine, but modalpopup hides even if validation is wrong, and i want it to stay open if a required field is not entered. i am wondering if my setup has it not working correctly.

    I notice you use "RequiredFieldValidator" to validate the control .From my point of view ,if the validate is failed , it will not cause page post back . In this situation ,the modal popup will not hide.

    Best Regards,

    Nan Yu

    Tuesday, August 25, 2015 6:02 AM