Using button for the trigger, after can't click the button - asp.net

Im using Button for some triggers, use the trigger but cant click, im remove the trigger, after button work but page header not displayed
look ate this
<asp:ImageButton ID="btnOderhelp" runat="server" OnClick="btnOderhelp_Click" ForeColor="White" ToolTip="Help" Height="25px" ImageUrl="~/img/help.png" />
<div class="col-md-12">
<div class="col-sm-2">
<asp:Label ID="Label2" runat="server" Text="Order No" Font-Bold="True" Font-Names="arial, helvetica, sans-serif" Font-Size="13px"></asp:Label>
</div>
<div class="col-sm-3">
<asp:TextBox ID="txtoder" MaxLength="15" runat="server" CssClass="form-control" Width="348px" placeholder="Oder Placement No/Style Name"></asp:TextBox>
<asp:HiddenField ID="hdnoder" runat="server"></asp:HiddenField>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtoder" CssClass="error" ErrorMessage="RequiredFieldValidator" Display="Dynamic" ValidationGroup="save" Font-Size="11px" ForeColor="Red">Order No Required!</asp:RequiredFieldValidator>
</div>
<div class="col-md-1" style="left: 30px;">
<asp:Label ID="Label8" runat="server" ForeColor="Red" Text="*"></asp:Label>
<asp:ImageButton ID="btnOderhelp" runat="server" OnClick="btnOderhelp_Click" ForeColor="White" ToolTip="Help" Height="25px" ImageUrl="~/img/help.png" />
...
</div>
...
</div>
I tried to use <asp:PostBackTrigger ControlID ="btnOderhelp" /> but it's not working for me, I can't click the button.

Make sure you have a <ScriptManager /> with
EnablePartialRendering="true"
Wrap the content you want to refresh
with a an UpdatePanel
Define your
Triggers
Exmaple
<asp:ScriptManager ID="ScriptManager1" EnablePartialRendering="True" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" ChildrenAsTriggers="true" runat="server">
<ContentTemplate>
<div class="row">
<div class="col-md-12">
<div class="col-sm-2">
<asp:Label ID="Label2" runat="server" Text="Order No" Font-Bold="True" Font-Names="arial, helvetica, sans-serif" Font-Size="13px"></asp:Label>
</div>
<div class="col-sm-3">
<asp:TextBox ID="txtoder" MaxLength="15" runat="server" CssClass="form-control" Width="348px" placeholder="Oder Placement No/Style Name"></asp:TextBox>
<asp:HiddenField ID="hdnoder" runat="server"></asp:HiddenField>
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtoder" CssClass="error" ErrorMessage="RequiredFieldValidator" Display="Dynamic" ValidationGroup="save" Font-Size="11px" ForeColor="Red">Order No Required!</asp:RequiredFieldValidator>
</div>
<div class="col-md-1" style="left: 30px;">
<asp:Label ID="Label8" runat="server" ForeColor="Red" Text="*"></asp:Label>
</div>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnOderhelp" />
</Triggers>
</asp:UpdatePanel>
<asp:ImageButton ID="btnOderhelp" runat="server" OnClick="btnOderhelp_Click" ForeColor="White" ToolTip="Help" Height="25px" ImageUrl="~/img/help.png" />

Please use ajax updatepanel or set on aspx page EnableEventValidation="false"
<div class="modal fade" role="dialog" id="eventdis" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<asp:UpdatePanel ID="updatedes" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Edit Voter Profile</h4>
</div>
<div class="modal-body">
<p>Mobile Number</p>
<asp:TextBox ID="txt_editVmobile" runat="server" CssClass="form-control placeholder-no-fix" placeholder="Mobile Number" autocomplete="off"></asp:TextBox>
<p>Status</p>
<asp:DropDownList ID="drp_edits" runat="server" CssClass="form-control"></asp:DropDownList>
<p>Caste</p>
<asp:DropDownList ID="drp_editc" runat="server" CssClass="form-control"></asp:DropDownList>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-primary" type="button">Cancel</button>
<asp:Button ID="btn_EditVoterProfile" runat="server" Text="Submit" OnClientClick="return hindModel();" CssClass="btn btn-danger" OnClick="btn_EditVoterProfile_Click" />
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>

Related

Why are my two modals on the same page triggering each others validate?

Pretty new to asp.net. So I just wanted to have multiple modals on my page, like I can do it in HTML. But the problem here is, that the first modal of the code works fine. But the second modal triggers on submit all of the RequiredFieldValidators of the first modal, and doesn't fire it's own function on the code behind (eventEintragen()). The function exists thats for sure.
I searched trough my whole code and checked every call. It has to be a problem with the modals itself, i'm guessing I missunderstood smth about asp.net and got both of the modals in conflict with each others. I would be gratefull for some help... Of course I looked into some other questions, but as you can guess, it's pretty hard to find someone with the same conflict problem.
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div class="container">
<div class="row">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
Event erstellen
</button>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<!--Modal-->
<asp:Label ID="Label1" runat="server" Text=""></asp:Label>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<asp:ValidationSummary runat="server" CssClass="text-danger" />
<div class="form-group">
<asp:TextBox runat="server" ID="Wettkampfname" placeholder="Wettkampfname" CssClass="form-control" TextMode="SingleLine" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Wettkampfname" CssClass="text-danger" ErrorMessage="Bitte Wettkampfname eingeben." />
</div>
<div class="form-group">
<asp:TextBox runat="server" ID="Teilnehmeranzahl" placeholder="Teilnehmeranzahl" CssClass="form-control" TextMode="SingleLine" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Teilnehmeranzahl" CssClass="text-danger" ErrorMessage="Bitte Wettkampfname." />
<asp:CompareValidator runat="server" Operator="DataTypeCheck" CssClass="text-danger" Type="Integer" ControlToValidate="Teilnehmeranzahl" ErrorMessage="Die Anzahl muss eine Zahl sein" />
</div>
<div class="form-group">
<asp:TextBox runat="server" ID="Strasse" placeholder="Strasse" CssClass="form-control" TextMode="SingleLine" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Strasse" CssClass="text-danger" ErrorMessage="Bitte Strasse eingeben." />
</div>
<div class="form-group">
<asp:TextBox runat="server" ID="Ort" placeholder="Ort" CssClass="form-control" TextMode="SingleLine" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Ort" CssClass="text-danger" ErrorMessage="Bitte Strasse eingeben." />
</div>
<div class="form-group">
<asp:TextBox runat="server" ID="Hausnummer" placeholder="Hausnummer" CssClass="form-control" TextMode="SingleLine" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Hausnummer" CssClass="text-danger" ErrorMessage="Bitte Hausnummer eingeben." />
<asp:CompareValidator runat="server" Operator="DataTypeCheck" CssClass="text-danger" Type="Integer" ControlToValidate="Hausnummer" ErrorMessage="Die Hausnummer muss eine Zahl sein" />
</div>
<div class="form-group">
<asp:TextBox runat="server" ID="Zeit" placeholder="Zeit (hh:mm)" CssClass="form-control" TextMode="SingleLine" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Zeit" CssClass="text-danger" ErrorMessage="Bitte Strasse eingeben." />
<asp:RegularExpressionValidator CssClass="text-danger" runat="server" ErrorMessage="Zeit Format in hh:mm" ValidationExpression="^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$" ControlToValidate="Zeit" />
</div>
<div class="form-group">
<asp:TextBox runat="server" ID="Datum" placeholder="Datum" CssClass="form-control" TextMode="Date" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Datum" CssClass="text-danger" ErrorMessage="Bitte Strasse eingeben." />
</div>
</div>
<div class="modal-footer">
<asp:Button Text="Save" OnClick="eventErstellen" runat="server" CssClass="btn btn-primary"/>
<asp:Button Text="Close" OnClick="Submit" runat="server" data-dismiss="modal" CssClass="btn btn-secondary"/>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
<div class="container">
<div class="row">
<button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#mySecondModal">
Für Event eintragen
</button>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<!--Modal-->
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>
<div class="modal fade" id="mySecondModal" tabindex="-1" role="dialog" aria-labelledby="mySecondModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<asp:DropDownList ID="ddlSubject" runat="server" AppendDataBoundItems="true">
<asp:ListItem Text="<Select Subject>" Value="0" />
</asp:DropDownList>
</div>
<div class="modal-footer">
<asp:Button Text="Save" OnClick="eventEintragen" runat="server" CssClass="btn btn-primary"/>
<asp:Button Text="Close" OnClick="Submit" runat="server" data-dismiss="modal" CssClass="btn btn-secondary"/>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>

ASP Modal Popup appears behind gridview after 3 clicks

I have a page with multiple modal popups and a gridview. If i open the popups 3 times the grid goes infront of the popup. I am pretty sure it has somethign to do witht eh update panels but i am stumped.
Here is the Code
<asp:UpdatePanel ID="NewCustCarUP" runat="server">
<ContentTemplate>
<asp:button ID="NewCustButton" runat="server" CssClass="btn btn btn-success" text="Add Customer" OnClick="NewCustButton_Click"/>
<asp:button ID="NewCarButton" runat="server" CssClass="btn btn btn-primary" text="Add Carrier" OnClick="NewCarButton_Click"/>
<!-- MP ADD CUST -->
<asp:LinkButton ID="lnkFake" runat="server"></asp:LinkButton>
<cc1:ModalPopupExtender ID="mpAddCust" runat="server" PopupControlID="NewCustPanel" TargetControlID="lnkFake"
CancelControlID="btnClose" BackgroundCssClass="modalBackground" RepositionMode="RepositionOnWindowResizeAndScroll">
</cc1:ModalPopupExtender>
<asp:Panel ID="NewCustPanel" runat="server" CssClass="modalPopup" style = "display: none; width:65%; height:90%; overflow:scroll; ">
<div class="row">
<div class="col-sm-4"></div>
<div class="col-sm-4"><br />
<asp:Button ID="newCustInsert" runat="server" UseSubmitBehavior="false" OnClick="newCustInsert_Click" CssClass="btn btn-success" ValidationGroup="NewCust" Text="Add Customer" />
<asp:Button ID="btnClose" runat="server" Text="Close" CssClass="btn btn-danger" />
</div>
<div class="col-sm-4 col-md-4 col-lg-4"></div>
</div>
</asp:Panel>
<!-- END MP ADD CUST -->
<!-- MP ADD CARRIER -->
<asp:LinkButton ID="lnkFake1" runat="server"></asp:LinkButton>
<cc1:ModalPopupExtender ID="mpAddCar" runat="server" PopupControlID="NewCarPanel" TargetControlID="lnkFake1"
CancelControlID="btnCloseCar" BackgroundCssClass="modalBackground" RepositionMode="RepositionOnWindowResizeAndScroll">
</cc1:ModalPopupExtender>
<asp:Panel ID="NewCarPanel" runat="server" CssClass="modalPopup" style = "display: none; width:65%; height:90%; overflow:scroll; ">
<div class="row">
<div class="col-sm-4">
.....Code with textboxes</div>
<div class="col-sm-4">
<asp:Button ID="InsertCarBtn" runat="server" Text="Add Carrier" CssClass="btn btn-success" OnClick="InsertCarBtn_Click" ValidationGroup="NewCar" />
<asp:Button ID="btnCloseCar" runat="server" Text="Close" CssClass="btn btn-danger" />
</div>
<div class="col-sm-4 col-md-4 col-lg-4"></div>
</div>
</asp:Panel>
<!-- END MP ADD CARRIER -->
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="MPStatusUP" runat="server">
<ContentTemplate>
<asp:panel ID="StatusPanel" runat="server" CssClass="modalPopup" style="z-index: 10000; position: relative;" >
<div class="row">
<div class="col-sm-4">
....Content
</div>
<div class="col-sm-4">
<asp:button ID="StatusbtnUpdate" runat="server" Text="Update" CssClass="btn btn-success" OnClick="StatusbtnUpdate_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btn btn-danger" OnClientClick = "return Hidepopup()"/>
</div>
<div class="col-sm-4 col-md-4 col-lg-4"></div>
</div>
</asp:panel>
<asp:LinkButton ID="lnkFake3" runat="server"></asp:LinkButton>
<cc1:ModalPopupExtender ID="StatusMP" runat="server" DropShadow="false"
PopupControlID="StatusPanel" TargetControlID = "lnkFake3"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel ID="Gridview1UP" runat="server" ChildrenAsTriggers="true"
UpdateMode="Conditional">
<ContentTemplate>
<asp:gridview ID="GridView1" runat="server"
DataSourceID="ActiveLoadsSQL" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px" Width="100%"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged" OnRowDataBound="GridView1_RowDataBound"
DataKeyNames="LoadID" AllowSorting="true" AllowPaging="true" Font-Size="Smaller" CssClass="table table-hover"
pagesize="25">
<Columns>
<asp:TemplateField HeaderText="loadID" InsertVisible="False" SortExpression="loadID">
<ItemTemplate>
<asp:Label ID="loadIDLabel" runat="server" Text='<%# Bind("loadID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</asp:TemplateField>
<asp:TemplateField HeaderText="Status">
<ItemTemplate>
<asp:Button ID="UpdateStatusModalbtn" OnClick="UpdateStatusModalbtn_Click" runat="server" CommandName="select" CssClass="btn btn-info btn-xs" text="Update"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle VerticalAlign="Top" />
</asp:gridview>
</ContentTemplate>
</asp:UpdatePanel>
It all works great until i get i click on a button 3 times on the status modal inside the GV and 4 times on the Add Customer and carrier outside of the GV. Thanks for your help!!
Fixed with this post
AJAX ModalPopup Pops Behind (Under) Page Content (Negative z-index)
.ModalPopup
{
z-index: 6001 !important;
}
.ModalPopupBackground
{
z-index: 6000 !important;
}

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).

Aligning .aspx buttons

I have an update panel that contains a label, a dropDownList and two buttons:
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="dropDownList" style="position:relative;" runat="server">
<label>
Select New File: </label>
<div id="ddl" runat="server">
<asp:DropDownList runat="server" ID="ddlCaseFiles" DataSourceID="dsMyCaseFiles" DataTextField="Display"
DataValueField="FileID" OnPreRender="ddl_PreRender" Width="524px" OnSelectedIndexChanged="ddlCaseFiles_SelectedIndexChanged" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddlCaseFiles"
ToolTip="Casefile Required" InitialValue="-1" Text="*" Display="Dynamic" />
<ajaxToolkit:ListSearchExtender ID="ddlExtCaseFiles" runat="server" PromptCssClass="ListSearchExtenderPrompt"
TargetControlID="ddlCaseFiles" BehaviorID="ddlExtCaseFiles" Enabled="True" />
</div>
<br />
<asp:Button ID="btnMoveCaseFile" runat="server" Text=""
style="float:left;" onclick="btnMoveCaseFile_Click"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel"
style="float:right" onclick="btnCancel_Click"/>
<br />
</div>
<asp:Label runat="server" ID="lblStatus"></asp:Label>
</ContentTemplate>
I am trying to get my buttons to line up like this:(button at the beginning of the DropDownList and a button at the End)
I've tried float-absolute etc.
I figured it out. Seems as though you have to add in px after the number.....
<asp:Button ID="btnMoveCaseFile" runat="server" Text=""
style="position:absolute; float:left; margin-left:104px;" onclick="btnMoveCaseFile_Click"/>
<asp:Button ID="btnCancel" runat="server" Text="Cancel"
style="position:relative; float:right; margin-right:63px;"
since I had margin-right:63; instead of margin-right:63px;

popup is getting disaapeared after dropdown selection

<asp:Panel id="container" CssClass="container" runat="server" style="width:850px">
<asp:Panel runat="server" id="header" cssClass="header" >
<div class="msg"> </div>
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClientClick="clearDataKey()" />
</asp:Panel>
<div runat="server" id="whatup">
<asp:Panel ID="Panel2" runat="server" >
<uc1:messageBox ID="InfoBox" runat="server" />
</asp:Panel>
</div>
<asp:updatepanel ID="upcsconfirmation" runat="server">
<ContentTemplate>
<cc1:ModalPopupExtender ID="popupCS" runat="server" BehaviorID="popupCS" TargetControlID="btnTargetCS"
PopupControlID="pnlPopupCS" BackgroundCssClass="modalBackground"/>
<asp:Button ID="btnTargetCS" runat="server" Text="Button" cssClass="hide" />
<cc1:DragPanelExtender ID="DragPanelExtenderCS" TargetControlID="pnlPopupCS" runat="server"></cc1:DragPanelExtender>
<asp:Panel ID="pnlPopupCS" runat="server" SkinID="modal"></asp:Panel>
</ContentTemplate>
</asp:updatepanel>
<div class="body" >
<div class="contentarea" style="height:200px;">
<asp:TextBox ID="datakeyholder" runat="server" style="display:none" Enabled="False" />
<asp:ObjectDataSource ID="odsCopyCustRequirements" runat="server" InsertMethod="InsertSearchRequirement"
TypeName="SearchRequirementsDataObject"
oninserting="Requirements_Inserting" >
</asp:ObjectDataSource>
<div style="height: 100%; width: 100%">
<div id="Div1" style="float: left; width: 45%; padding-left:10px">
<div class="column130">
<asp:Label ID="lblSearch1" runat="server" Text="FAST Region:"></asp:Label></div>
<asp:UpdatePanel ID="UpnlCust" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="column130">
<asp:DropDownList ID="ddSearch1" AutoPostBack="true" DataTextField="Name"
OnSelectedIndexChanged="ddSearch_SelectedIndexChanged" DataValueField="id"
runat="server" Width="150px">
</asp:DropDownList>
</div>
<div class="column130">
<asp:Label ID="lblSearch2" runat="server" Text="Owning Office:"></asp:Label></div>
<div class="column130">
<asp:DropDownList ID="ddSearch2" DataTextField="Name" DataValueField="fastid"
runat="server" Width="150px">
</asp:DropDownList>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddSearch1" />
</Triggers>
</asp:UpdatePanel>
<div class="column">
</div>
</div>
</div>
</div>
<p></p>
The upper update panel (upcsconfirmation) containing modal popup extender should have UpdateMode = "Conditional" - otherwise, asynchronous post-back from bottom update panel will also update its content restoring the modal popup to hidden state.
Yet another way to solve your issue is to use Show method of popup extender on server side when the bottom update panel posts back (for example, you can put the call popupCS.Show() in ddSearch_SelectedIndexChanged to keep the modal popup open).

Resources