bootstrap collapse collapses when clicking on calendar icon - asp.net

I have a bootstrap panel-collapse as follows
<div class="panel-heading">
Business/Financial Information <a data-toggle="collapse" href="#BusFinInfo"><span class="glyphicon glyphicon-collapse-down"></span></a>
</div>
<div id="BusFinInfo" class="panel-collapse collapse">
and an ajax calendar extender as follows
<div class="input-group">
<asp:TextBox ID='txtTermNotifctnDate' runat='server' CssClass='form-control'></asp:TextBox>
<span class="input-group-addon" id="inputCalenderTermNotifctnDate">
<asp:LinkButton ID="lnkBtnTermNotifctnDate" runat="server"><i class="icon-Calendar"></i></asp:LinkButton>
</span>
<ajaxtoolkit:CalendarExtender ID="ceTermNotifctnDate" runat="server" TargetControlID="txtTermNotifctnDate"
PopupButtonID="lnkBtnExecutionDate" PopupPosition="BottomLeft" Format="MM/dd/yyyy"></ajaxtoolkit:CalendarExtender>
</div>
The problem is that when I click on the calendar control, the panel collapses.

Simple mistake that I overlooked. PopupButtonID was wrong and didn't match the link button.

Related

Wrapping ASP Form inside Bootstrap Layout

I have built a form in HTML 5 that is in a modal window and wrapped in Bootstrap and the layout is perfect. I have the need to use another modal window, however instead of the form being built in HTML 5 I need to place and iframe in the modal and display and asp form. I have wrapped everything identically in Bootstrap, but for some reason the label next to my form control displays on top and not next to. I'm stumped, I have played with CSS for two days now trying to figure out why. Thoughts?
HTML CODE FOR FORM THAT LAYS OUT PERFECT
<div class="modal fade" id="myModal">
<div class="modal-dialog">
<div class="modal-content" style="width:100%">
<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">Observation Form</h4>
</div>
<div class="modal-body">
<form class="well form-horizontal" action=javascript:createNewObservation() method="post" id="observationForm">
<fieldset>
<!-- Form Name -->
<!-- Enter Building -->
<div class="form-group">
<label class="col-md-3 control-label">Building</label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span>
<select id="formBuilding" name="formBuilding" class="form-control selectpicker" required></select>
</div>
</div>
</div>
IMAGE FOR PERFECT LAYOUT
ASP CODE WRAPPED IN IFRAME THAT IS DISPLAYING IN MODAL
<form id="form1" runat="server" class="well form-horizontal">
<fieldset>
<legend>File Upload Form</legend>
<div class="form-group">
<label class="col-md-3 control-label">Choose File</label>
<div class="col-md-8 inputGroupContainer">
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-home"></i></span>
<asp:FileUpload class="form-control" ID="FileUpload1" runat="server" style="width:50%" />
</div>
</div>
</div>
<asp:HiddenField ID="site" runat="server" />
<asp:HiddenField ID="dateobserved" runat="server" />
<asp:HiddenField ID="guid" runat="server" />
<asp:HiddenField ID="username" runat="server" />
<asp:Button class="btn btn-primary pull-right" ID="Button1" runat="server" OnClick="Button1_Click" Text="Upload" />
</fieldset>
</form>
IMAGE FOR INCORRECT LAYOUT
To me it seems like you need to set a width to the iframe 'cause the modal size isn't changing. Try set width to 100% for the iframe

DataBinder.Eval as ID does not work with href

I am generating panel dynamically using a ListView control. I'm trying to use Bootstrap collapsible panels. The problem I'm having is using the DataBinder.Eval as the id of the collapsible panel body. I am assuming that the href is correct because if I hard-code the id rather than use the DataBinder.Eval, the panel opens and closes correctly, but when I substitute the hard-coded id for the DataBinder.Eval the panel does not open. Here is my HTML:
<div class="panel-heading">
<h4 class="panel-title">
<a data-toggle="collapse" href="#<%#Eval("ModuleKey") %>"><%#Eval("ModuleKey") %></a>
</h4>
</div>
<div id='<%# DataBinder.Eval(Container.DataItem, "ModuleKey")%>' class="panel-collapse collapse">
<div class="panel-body">Panel Body</div>
</div>
Any assistance is greatly appreciated!

Cannot Bind to asp:Dropdownlist in Bootstrap Modal

For some reason, I cannot bind to an asp:Dropdownlist inside a Modal, and I can't figure out what I am missing. If I move the dropdownlist outside of the Modal, that data binds perfectly, but inside the Modal, the dropdownlist is always blank. Can someone please tell me what I am missing here:
Here is the Modal:
<div id="copyEmployeeModal" class="md-modal colored-header md-effect-9 prmiary">
<div class="md-content">
<div class="modal-header">
<button type="button" data-dismiss="modal3" aria-hidden="true" class="close md-close" onclick="return CloseModal();"><i class="icon s7-close"></i></button>
<h3 class="modal-title">
<asp:Label ID="lblcopyEmployeeModalTitle" runat="server" Text="Copy Employee Permissions"></asp:Label>
</h3>
</div>
<div class="modal-body form" style="padding: 0px!important;">
<asp:DropDownList ID="ddlNonGroupEmployees" runat="server" CssClass="form-control" AutoPostBack="true"></asp:DropDownList>
</div>
</div>
</div>
Here is the code to bind the dropdownlist:
ddlNonGroupEmployees.DataSource = GetNonGroupEmployees();
ddlNonGroupEmployees.DataTextField = "DisplayName";
ddlNonGroupEmployees.DataValueField = "EmployeeId";
ddlNonGroupEmployees.DataBind();
I know the above code has data, and as I said if I move the dropdownlist out of the modal and place it on the page, the data binds to the dropdownlist with no issues. Can anyone tell me what I am missing here?
Any assistance is greatly appreciated!

Left align one button and right align two buttons in Bootstrap panel [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have a panel with three buttons in the panel body. I want one button to be where it currently is (left) and I want the other two buttons to be on the far right.
The buttons currently are all aligned to the left. Below is the code I have written. I have tried numerous things including pull-right and adding button groups and clearfix, but they remain left most.
I have also tried this post: Left align and right align within div in Bootstrap
I am using bootstrapmin for both CSS and JS.
Here is the code:
<div class="row">
<div class="form-inline">
<div class="col-sm-5" style="width: 100%;">
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">Click 'Run' to complete the report.</div>
<div class="panel-body" style="background-color: lightgray;">
<div class="form-group">
<asp:Button ID="btnRun" runat="server" Text="Run" OnClick="btnRun_Click"
class="btn btn-primary btn-sm"/>
<div class="btn-group">
<span class="pull-right">
<asp:Button ID="btnReset" runat="server" Text="Reset" class="btn btn-primary btn-sm" />
<asp:Button ID="btnExport" runat="server" Text="Export to CSV" class="btn btn-primary btn-sm" />
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel-body" style="background-color: lightgray;">
<div>
<asp:Button ID="btnRun" runat="server" Text="Run" OnClick="btnRun_Click" class="btn btn-primary btn-sm" />
<asp:Button ID="btnReset" runat="server" Text="Reset" class="btn btn-primary btn-sm myFloat_Right" />
<asp:Button ID="btnExport" runat="server" Text="Export to CSV" class="btn btn-primary btn-sm myFloat_Right" />
</div>
</div>
and in your cs file add the following:
.myFloat_Right {
float: right;
}
worked for me.
You were on the right track. The only thing you had to do was to use the bootstrap classes accordingly. If you pay attention, you'll see they work as a map. 1. build a container, 2. build a row, 3. build a column size, 4. build the element, 5. locate it. In this case, you had to wrap the left button in a left column, and the right btn-group in a right container with pull-left and pull-right. Mind you, in your #media responsive code you have to nullify the pull-right so that they don't look funny in a smartphone. I am assuming you are building a responsive design otherwise you wouldn't use Bootstrap. ;)
Here is a codepen for your solution
enter link description here
p.s. Avoid inline styles like the plague. Specially where you have a col-sm-5 but you are forcing a width to 100%. Doesn't make any sense to do that. Use col-xs-12 if you want a 100% width
Try this
<div class="row">
<div class="form-inline">
<div class="col-sm-5" style="width: 100%;">
<div class="panel-group">
<div class="panel panel-primary">
<div class="panel-heading">Click 'Run' to complete the report.</div>
<div class="panel-body" style="background-color: lightgray;">
<div class="pull-left">
<asp:Button ID="btnRun" runat="server" Text="Run"
class="btn btn-primary btn-sm" />
</div>
<div class="pull-right">
<asp:Button ID="btnReset" runat="server" Text="Reset" class="btn btn-primary btn-sm" />
<asp:Button ID="btnExport" runat="server" Text="Export to CSV" class="btn btn-primary btn-sm" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>

Dragging a popup modal extender inside an usercontrol

I'm trying to use a modal popup extender.
But I have a problem when using it inside an userControl.
I put the drag property true, and PopupDragHandleControlID but I can't drag the popup.
It seams that this problem happens only when I use the popup modal extender inside the userControl.
If I use it inside an aspx page, then it is OK.
Please can you help me how to deal with this problem?
Here is the code that I use in my user control:
<asp:LinkButton ID="lnk" runat="server" Text="Rezervo"></asp:LinkButton>
<ajax:ModalPopupExtender ID="ModalPopupExtender1" BackgroundCssClass="ModalPopupBG"
runat="server" CancelControlID="btnCancel" OkControlID="btnOkay" TargetControlID="lnk"
PopupControlID="pnlBooking" Drag="true" PopupDragHandleControlID="PopupHeader">
</ajax:ModalPopupExtender>
<div id="pnlBooking" style="display: none;" class="popupConfirmation">
<div class="popup_Container">
<div class="popup_Titlebar" id="PopupHeader">
<div class="TitlebarLeft">
Rezervo</div>
<div class="TitlebarRight">
</div>
</div>
<div class="popup_Body">
</div>
<div class="popup_Buttons">
<input id="btnOkay" value="Done" type="button" />
<input id="btnCancel" value="Cancel" type="button" />
</div>
</div>
</div>

Resources