ASP.net DropDownList, SelectedIndexChanged Not Working - asp.net

I tried every way but it didn't work at all. I would be glad if you can help. Trigger, AutoPostBack etc. I added everything, but still could not reach the solution in any way. Thank you.
<%# Page Language="C#" AutoEventWireup="true" CodeFile="prequest.aspx.cs" Inherits="musteri_prequest" validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>
<form id="form-login" class="text-start">
<form runat="server">
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<div class="mb-3">
<label class="form-label" id="lbl-nombre" for="txt-nombre" style="font-family: Montserrat, sans-serif;font-size: 15px;font-weight: bold;">Cihaz Seçiniz:</label>
<asp:DropDownList ID="prequ_cihaz" runat="server" AutoPostBack="True" EnableViewState="true" CssClass="form-control" style="border-color: var(--first-color);margin-bottom: 15px;" OnSelectedIndexChange = "Prequ_cihaz_SelectedIndexChanged"></asp:DropDownList>
<label class="form-label" id="lbl-nombre-1" for="txt-nombre" style="font-family: Montserrat, sans-serif;font-size: 15px;font-weight: bold;">Problem Türü:</label>
<asp:DropDownList ID="prequ_prob" runat="server" CssClass="form-control" style="border-color: var(--first-color);margin-bottom: 15px;"></asp:DropDownList>
</div>
<div class="mb-3"></div>
<div class="mb-3"></div>
<div class="mb-3">
<asp:Label ID="prequest_label" runat="server" Text="" style="color:rgb(148,0,211); font-family: Alatsi, sans-serif; margin-bottom: 9px;" ></asp:Label>
<label class="form-label" id="lbl-nombre-1" for="txt-nombre" style="font-family: Montserrat, sans-serif;font-size: 15px;font-weight: bold;">Probleminizi açıklayınız.</label>
<asp:TextBox ID="prequest_exp" runat="server" TextMode="MultiLine" Rows="5" CssClass="form-control form-control-lg" style="border-color: var(--first-color);margin-bottom: 15px;"></asp:TextBox>
</div>
<div class="text-center">
<asp:Button ID="prequest_button" runat="server" onClick="prequest_button_Click" Text="Gönder" CssClass="btn btn-primary text-center" style=" background: var(--bs-indigo);" />
</div>
</contenttemplate>
</asp:UpdatePanel>
</form>
protected void Prequ_cihaz_SelectedIndexChanged(object sender, EventArgs e)
{
a = prequ_cihaz.SelectedIndex;
prequest_exp.Text = "Run!";
}

I found out that the error was due to two nested <form> tags.
Solution:
<form runat="server" class="text-start" style="max-width: 70%; margin: 0 auto; margin-top: 20px;">
<div class="mb-3"><label class="form-label" id="lbl-nombre" for="txt-nombre" style="font-family: Montserrat, sans-serif;font-size: 15px;font-weight: bold;">Cihaz Seçiniz:</label><asp:DropDownList ID="prequ_cihaz" runat="server" AutoPostBack="True" EnableViewState="true" CssClass="form-control" style="border-color: var(--first-color);margin-bottom: 15px;" OnSelectedIndexChanged = "Prequ_cihaz_SelectedIndexChanged">
<asp:ListItem>Cihaz Seçiniz</asp:ListItem></asp:DropDownList>
<label class="form-label" id="lbl-nombre-1" for="txt-nombre" style="font-family: Montserrat, sans-serif;font-size: 15px;font-weight: bold;">Problem Türü:</label><asp:DropDownList ID="prequ_prob" runat="server" CssClass="form-control" style="border-color: var(--first-color);margin-bottom: 15px;"></asp:DropDownList></div>
<div class="mb-3"></div>
<div class="mb-3"></div>
<div class="mb-3"><asp:Label ID="prequest_label" runat="server" Text="" style="color:rgb(148,0,211); font-family: Alatsi, sans-serif; margin-bottom: 9px;" ></asp:Label><label class="form-label" id="lbl-nombre-1" for="txt-nombre" style="font-family: Montserrat, sans-serif;font-size: 15px;font-weight: bold;">Probleminizi açıklayınız.</label><asp:TextBox ID="prequest_exp" runat="server" TextMode="MultiLine" Rows="5" CssClass="form-control form-control-lg" style="border-color: var(--first-color);margin-bottom: 15px;"></asp:TextBox></div>
<div class="text-center"><asp:Button ID="prequest_button" runat="server" onClick="prequest_button_Click" Text="Gönder" CssClass="btn btn-primary text-center" style=" background: var(--bs-indigo);" /></div>
</form>

Related

margin-left is not working in asp.net label

Please find my code below.
<div style="position:relative">
<asp:Label ID="lbl_details" runat="server" style="margin-top:50px;display:inline-block" Text="Details"
Width="150px"></asp:Label>
<textarea id="txtarea_details" runat="server" cssclass="textbox" maxlength="150" columns="30" rows="5"
style="border:1px solid #CCC; margin-top:0px; margin-left:0px; width:191px; white-space:pre-wrap"></textarea>
<asp:Label ID="Label12" runat="server"
Text=" &nbsp Remarks"
Width="345px"></asp:Label>
<asp:TextBox ID="txt_remarks" runat="server" style="margin-top:0px;" CssClass="textbox"></asp:TextBox>
</div>
<div style="position:relative">
<div style="width:30%;float:left,text-allign:right,padding:50px,0px,0px,15px">
<asp:Label ID="lbl_details" runat="server" Text="Details" ></asp:Label>
</div>
<div style="width:70%;float:left,text-allign:left,padding:50px,0px,0px,15px">
<textarea id="txtarea_details" runat="server" cssclass="textbox" maxlength="150" columns="30" rows="5"
style="border:1px solid #CCC; margin-top:0px; margin-left:0px; width:191px; white-space:pre-wrap"></textarea>
<div style="width:30%;float:left,text-allign:right,padding:50px,0px,0px,15px">
<asp:Label ID="Label12" runat="server"Text="Remarks"
Width="345px"></asp:Label>
</div>
<div style="width:70%;float:left,text-allign:right,padding:50px,0px,0px,15px">
<asp:TextBox ID="txt_remarks" runat="server" style="margin-top:0px;" CssClass="textbox"></asp:TextBox>
</div>
</div>

How do I display a ModalPopupExtender from another ModalPopupExtender and set which one has to be shown first?

I have a ModalPopUpExtender that contains a button that display a second ModalPopUpExtender . The problem is that when I show the second ModalPopUpExtender it appears behind the first. Is it any way i can set that the second ModalPopUpExtender was shown ahead of the fist one?
<asp:ToolkitScriptManager ID="ToolkitScriptManagerProfesiones" runat="server">
</asp:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanelAgenda" runat="server">
<ContentTemplate>
<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server" BackColor="#FFFFD5" BorderColor="Black" CssClassPrefix="calendar_default" DayFontFamily="Tahoma" DayFontSize="15pt" DurationBarColor="Blue" EventBackColor="White" EventBorderColor="Black" EventClickHandling="PostBack" EventFontFamily="Tahoma" EventFontSize="8pt" EventHoverColor="Gainsboro" HourBorderColor="#EAD098" HourFontFamily="Tahoma" HourFontSize="16pt" HourHalfBorderColor="#F3E4B1" HourNameBackColor="#ECE9D8" HourNameBorderColor="#ACA899" HourWidth="100" HoverColor="#FFED95" NonBusinessBackColor="#FFF4BC" StartDate="2015-03-25" TimeFormat="Clock24Hours" CellHeight="40" HeaderHeight="40" OnEventClick="DayPilotCalendar1_EventClick" OnTimeRangeSelected="DayPilotCalendar1_TimeRangeSelected" style="top: 0px; left: 0px; width: 375px; height: 501px; margin-right: 221px" Width="600px" TimeRangeSelectedHandling="PostBack" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:ModalPopupExtender ID="modificarTurno_ModalPopupExtender" runat="server" Enabled="True" PopupControlID="PanelModificarTurno" DropShadow="false" BackgroundCssClass="FondoAplicacion" TargetControlID="lb">
</asp:ModalPopupExtender>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" Enabled="True" PopupControlID="panelClientes" DropShadow="false" BackgroundCssClass="FondoAplicacion" TargetControlID="lbClientePop">
</asp:ModalPopupExtender>
<asp:Button ID="Button1" class="btn btn-info" runat="server" Text="Modificar" Visible="false" />
<asp:Panel ID="panelClientes" runat="server" >
<asp:Label ID="lbClientePop" runat="server" Style="display: none " ></asp:Label>
<asp:UpdatePanel ID="UpdatePanelCliente" runat="server">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" >
<h2> prueba</h2>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<asp:Panel ID="PanelModificarTurno" runat="server" >
<asp:Label ID="Lb" runat="server" Style="display: none"></asp:Label>
<asp:UpdatePanel ID="UpdatePanelModificarTurno" runat="server">
<ContentTemplate>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" >
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabelModificar16">Modificar turno</h4>
</div>
<div class="modal-body">
<div class="form-horizontal">
<fieldset>
<div class="form-group">
<label for="DropDownEstado" class="col-lg-2 control-label">Estado</label>
<div class="col-lg-6">
<asp:DropDownList ID="DropDownEstado" runat="server" CssClass="form-control" DataSourceID="SqlDataSourceEstado" DataTextField="estado" DataValueField="id"></asp:DropDownList>
<asp:SqlDataSource runat="server" ID="SqlDataSourceEstado" ConnectionString='<%$ ConnectionStrings:MiWeb.Properties.Settings.cs %>' SelectCommand="SELECT * FROM [Estado]"></asp:SqlDataSource>
</div>
</div>
<div class="form-group">
<asp:UpdatePanel ID="updatepanelboton" runat="server">
<ContentTemplate>
<label for="txtCliente" class="col-lg-2 control-label">Cliente</label>
<div class="col-lg-4">
<asp:TextBox ID="txtCliente" class="form-control" runat="server"></asp:TextBox>
</div>
<div class="col-lg-2">
<asp:Button runat="server" ID="BtnBuscarCliente" Text="..." OnClick="BtnBuscarCliente_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
<div class="form-group">
<label for="DropdownServicios" class="col-lg-2 control-label">Servicio</label>
<div class="col-lg-6">
<asp:DropDownList ID="DropdownServicios" runat="server" CssClass="form-control" DataSourceID="SqlDataSourceServicios" DataTextField="nombre" DataValueField="id" OnSelectedIndexChanged="DropdownServicios_SelectedIndexChanged"></asp:DropDownList>
<asp:SqlDataSource runat="server" ID="SqlDataSourceServicios" ConnectionString='<%$ ConnectionStrings:MiWeb.Properties.Settings.cs %>' SelectCommand="SELECT * FROM [Servicios] WHERE ([activo] = #activo)">
<SelectParameters>
<asp:Parameter DefaultValue="true" Name="activo" Type="Boolean" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</div>
<div class="form-group">
<label for="DropDownProfesioanles" class="col-lg-2 control-label">Profesional</label>
<div class="col-lg-6">
<asp:DropDownList ID="DropDownProfesioanles" runat="server" CssClass="form-control" ></asp:DropDownList>
</div>
</div>
<div class="form-group">
<label for="ChkPrimeraVez" class="col-lg-2 control-label">Primera vez? </label>
<div class="col-lg-6">
<asp:CheckBox ID="ChkPrimeraVez" runat="server" />
</div>
</div>
<div class="form-group">
<label for="DropDownHsInicio" class="col-lg-2 control-label">Inicio</label>
<div class="col-lg-4">
<asp:DropDownList ID="DropDownHsInicio" runat="server" CssClass="form-control" DataSourceID="SqlDataSourceHI" DataTextField="hora" DataValueField="id"></asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSourceHI" runat="server" ConnectionString='<%$ ConnectionStrings:MiWeb.Properties.Settings.cs %>' SelectCommand="SELECT * FROM [horarios]"></asp:SqlDataSource>
</div>
<label for="DropDownHsFin" class="col-lg-2 control-label">Fin</label>
<div class="col-lg-4">
<asp:DropDownList ID="DropDownListFin" runat="server" CssClass="form-control" DataSourceID="SqlDataSourceFI" DataTextField="hora" DataValueField="id" Enabled="False"></asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSourceFi" runat="server" ConnectionString='<%$ ConnectionStrings:MiWeb.Properties.Settings.cs %>' SelectCommand="SELECT * FROM [horarios]"></asp:SqlDataSource>
</div>
</div>
</fieldset>
</div>
</div>
<div class="modal-footer">
<asp:Button ID="BtnEliminarTurno" runat="server" class="btn btn-danger" Text="Eliminar turno" OnClick="BtnEliminarTurno_Click" />
<asp:Button ID="btnCancelarMod" runat="server" class="btn btn-default" Text="Cancelar" OnClick="btnCancelarMod_Click" />
<asp:Button ID="btnConfirmarMod" runat="server" class="btn btn-success" Text="Modificar" OnClick="btnConfirmarMod_Click" />
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
protected void btnConfirmarMod_Click(object sender, EventArgs e)
{
modificarTurno_ModalPopupExtender.Hide();
}
protected void BtnBuscarCliente_Click(object sender, EventArgs e)
{
ModalPopupExtender1.Show();
}
thanks in advance !
ModalPopupExtender "decides" on its own what z-index to use. Generally it will do the right thing.
The only way I know to assure that your second one will appear on top is to Not use a second ModalPopupExtender, but instead to assign the z-index of the second modal popup explicitly. I suggest 99999 for the second popup and 99998 for its blanket. I have seen typical z-index assigned by ModalPopupExtender in ranges of 50000 to 79000 (aprox).

Changing controls order in row class div bootstrap 3

Well, I'am building a web application that uses twitter bootstrap 3 , and supports both languages English and Arabic with two different master pages for each,
am using div with class .row to put my controls inside
controls inside rows by default starts from left to right
when I change my website language to Arabic I want to reverse all items inside rows from right to left
am changing the master page with my stylesheet files, I've tried floating and directions but it never works for me for items inside div with .row class
<asp:Panel ID="pnl_TaskContent" runat="server" class="row">
<asp:Panel ID="pnl_TaskColumn" runat="server" class="col-md-12">
<div class="box-body">
<div class="row">
<div class="col-md-3">
<%--Task Name--%>
<div class="form-group">
<asp:Label ID="lbl_Task_Name" runat="server" Text="Task Name" Font-Bold="True" Font-Italic="False"></asp:Label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-pencil">
<asp:RequiredFieldValidator ID="RequiredFieldValidator27" runat="server" ErrorMessage="*"
ControlToValidate="txt_Task_Name" ForeColor="Red" ValidationGroup="saveTask" Font-Bold="True" Font-Size="Medium"></asp:RequiredFieldValidator>
</i></span>
<asp:TextBox ID="txt_Task_Name" runat="server" ClientIDMode="Static" CssClass="form-control"></asp:TextBox>
<div class="input-group-btn">
<asp:Button ID="button_tf" CssClass="btn btn-default dropdown-toggle" runat="server" Text="Functions" data-toggle="dropdown" ValidationGroup="none" />
<ul class="dropdown-menu">
<li>
<asp:Button ID="btn_AddTaskFunModal" CssClass="btn btn-default btn-block" runat="server" ValidationGroup="novali" Text="Add/Edit" data-toggle="modal" data-target="#addTaskFunctions-modal" /></li>
<li>
<asp:Button ID="btn_BrowseTaskFunModal" CssClass="btn btn-default btn-block" runat="server" ValidationGroup="novali" Text="Edit" data-toggle="modal" data-target="#BrowseTaskFunctions-modal" /></li>
</ul>
</div>
</div>
</div>
</div>
<div class="col-md-3">
<%--Task Status--%>
<div class="form-group">
<asp:Label ID="lbl_Task_Status" runat="server" Text="Task Status" Font-Bold="True" Font-Italic="False"></asp:Label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-signal">
<asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ErrorMessage="*"
ControlToValidate="ddl_Task_Status" ForeColor="Red" ValidationGroup="saveTask" Font-Bold="True" Font-Size="Medium"></asp:RequiredFieldValidator>
</i></span>
<asp:DropDownList ID="ddl_Task_Status" runat="server" ClientIDMode="Static" CssClass="form-control" Enabled="False">
<asp:ListItem Value="N">New</asp:ListItem>
<asp:ListItem Value="A">Active</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col-md-3">
<%--Task Priority--%>
<div class="form-group">
<asp:Label ID="lbl_Task_Proirity" runat="server" Text="Task Priority" Font-Bold="True" Font-Italic="False"></asp:Label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-flag">
<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server" ErrorMessage="*"
ControlToValidate="ddl_Task_Proirity" ForeColor="Red" ValidationGroup="saveTask" Font-Bold="True" Font-Size="Medium"></asp:RequiredFieldValidator>
</i></span>
<asp:DropDownList ID="ddl_Task_Proirity" runat="server" ClientIDMode="Static" CssClass="form-control">
<asp:ListItem Value="H">High</asp:ListItem>
<asp:ListItem Value="M">Medium</asp:ListItem>
<asp:ListItem Value="L">Low</asp:ListItem>
</asp:DropDownList>
</div>
</div>
</div>
<div class="col-md-3">
<%--Completion Rate--%>
<div class="form-group">
<asp:Label ID="lbl_Task_CompRate" runat="server" Text="Completion Rate" Font-Bold="True" Font-Italic="False"></asp:Label>
<asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txt_Task_CompRate" ErrorMessage="0-100" Font-Bold="True" ForeColor="Red" MaximumValue="100" MinimumValue="0" SetFocusOnError="True" Type="Integer" ValidationGroup="saveTask"></asp:RangeValidator>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-flag">
<asp:RequiredFieldValidator ID="RequiredFieldValidator31" runat="server" ErrorMessage="*"
ControlToValidate="txt_Task_CompRate" ForeColor="Red" Font-Bold="True" Font-Size="Medium" ValidationGroup="saveTask"></asp:RequiredFieldValidator>
</i></span>
<asp:TextBox ID="txt_Task_CompRate" runat="server" ClientIDMode="Static" CssClass="form-control">0</asp:TextBox>
<span class="input-group-addon"><i><b>%</b>
</i></span>
</div>
</div>
</div>
</div>
what i want that when i change the display order to rtl, is to change the controls inside my row
When Direction From Left To Right but controls are not showing as expected
Well, you have unusable html in your post, so I can't test this, but last year I contributed to this old repository: https://github.com/carasmo/bootstrap-rtl/blob/master/dist/css/bootstrap-rtl.css
Has some useful code when you change direction. It's 3.1 but some of it still works well. You'll have to pick through it to see what you need to tweek.
Here's an example of the input-group fixes:
DEMO: http://jsbin.com/tipufu/1/edit
Assumes
body {direction:rtl}
CSS for RTL:
.input-group .form-control:first-child,
.input-group-addon:first-child,
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .dropdown-toggle,
.input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 0;
border-top-left-radius: 0;
}
.input-group-addon:first-child {
border-right: 1px solid #cccccc;
border-left: 0;
}
.input-group .form-control:last-child,
.input-group-addon:last-child,
.input-group-btn:last-child > .btn,
.input-group-btn:last-child > .dropdown-toggle,
.input-group-btn:first-child > .btn:not(:first-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-bottom-left-radius: 4px;
border-top-left-radius: 4px;
}
.input-group-addon:last-child {
border-right: 0;
border-left: 1px solid #cccccc;
}
.input-group-btn:first-child > .btn {
margin-left: -1px;
}
.input-group-btn:last-child > .btn {
margin-right: -1px;
}
.input-group-btn > .btn {
position: relative;
}
.input-group-btn > .btn + .btn {
margin-right: -4px;
}
.input-group-btn > .btn:hover,
.input-group-btn > .btn:active {
z-index: 2;
}
SOME HTML
<div class="input-group">
<span class="input-group-addon">#</span>
<input type="text" class="form-control" placeholder="Username">
</div>
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-addon">.00</span>
</div>
<div class="input-group">
<span class="input-group-addon">$</span>
<input type="text" class="form-control">
<span class="input-group-addon">.00</span>
</div>

Modal popup extender does not display the content after selection of item changed in drop down

I have a one dropdown box in webpage that is with autopostback = true and one modal popup extender in same webp age.. When i changed the selection and then open modal popup and enter value then close the modal popup.. It will postback and entered value does not display when open modal popup again....How i prevent postback when close modalpopup and getting same value again...
Please help for the same...My code is given below:
<asp:DropDownList runat="server" ID="ddlDBANameFormField" AutoPostBack="true" >
<asp:ListItem Selected="True" Text="Select"></asp:ListItem>
<asp:ListItem Text="One"></asp:ListItem>
<asp:ListItem Text="Two"></asp:ListItem>
<asp:ListItem Text="Three"></asp:ListItem>
</asp:DropDownList>
<div id="tempHotelStatistic">
<div id="MainHotelStatistic" style="width: 998px;" runat="server">
<div style="width: 330px; height: 30px; float: left;" id="RoomsRentedAfterAudit"
runat="server">
<div style="width: 150px; float: left;">
<asp:Label ID="lblRoomsRentedAfterAudit" runat="server" Text="After Audit Rooms:"
Width="175px" CssClass="label"></asp:Label>
</div>
<asp:UpdatePanel UpdateMode="Conditional" runat="server" ID="UpdatePanel3">
<ContentTemplate>
<div style="width: 150px; float: left;">
<table>
<tr>
<td>
<asp:TextBox ID="txtRoomsRentedAfterAudit" runat="server" CssClass="textboxpopup"></asp:TextBox>
<cc1:ModalPopupExtender ID="ModalPopupExtender4" OkControlID="ModalOKButtonRoomsRented"
runat="server" TargetControlID="btnpopupRoomsRented" CancelControlID="btnpopupCancelRoomsRented"
PopupControlID="PanelRoomRented" Drag="true" PopupDragHandleControlID="PopupHeader1" >
</cc1:ModalPopupExtender>
</td>
<td>
<asp:Button ID="btnpopupRoomsRented" runat="server" Text="...." CssClass="buttonpopup"
Style="color: #333333; margin-left: 0; margin-right: 0; width: 35px;" />
</td>
</tr>
</table>
</div>
<div id="PanelRoomRented" style="display: none;" class="popupConfirmation">
<div class="popup_Container">
<div class="popup_Titlebar" id="Div3">
<div class="TitlebarLeft">
Reason :
</div>
<div>
<asp:Button ID="btnpopupCancelRoomsRented" class="TitlebarRight " runat="server" />
</div>
</div>
<div>
<table>
<tr>
<td valign="top" height="5px">
</td>
</tr>
<tr>
<td valign="bottom">
<textarea id="txtRoomsRentedAfterAuditReason" runat="server" rows="20" cols="20"
style="width: 270px; height: 100px;"></textarea>
</td>
</tr>
<tr>
<td valign="top" height="5px">
</td>
</tr>
</table>
</div>
</div>
<div class="popup_Container" align="right">
<asp:Button ID="ModalOKButtonRoomsRented" runat="server" Width="60px" Text="OK" CssClass="buttonForPopUp" />
</div>
</div>
<cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender111" runat="server" FilterType="Custom,Numbers"
ValidChars="-" FilterMode="ValidChars" TargetControlID="txtRoomsRentedAfterAudit">
</cc1:FilteredTextBoxExtender>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnpopupRoomsRented" />
</Triggers>
</asp:UpdatePanel>
</div>
</div>
</div>
Solved the problem by applying trigger for the update panel , in which modal popup resides...
<Triggers>
<asp:PostBackTrigger ControlID="ddlDBANameFormField" />
</Triggers>

RequiredFieldValidator inside ModalPopup causing problems

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?
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 :(
Can you please check if your Button (or some other control) that open the popup and the modaldialog extender are outside the update panel?
I got strange problems with modalpopup too. I would suggest you to try something different, for example a numericupdown control from the ajaxcontroltoolkit, if you already use it. So you don't need any validator for this.
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<div class="item smalltitle gapontop ">
Number of Seats:
</div>
<div class="item">
<asp:TextBox ID="txtNoSeats" runat="server" Width="50px"></asp:TextBox>
<cc1:NumericUpDownExtender ID="txtNoSeatsExt" runat="server"
Enabled="true" Minimum="1" Maximum="100" TargetControlID="txtNoSeats" Width="50" />
</div>

Resources