Ajax CalendarExtender弹出位置 [英] Ajax CalendarExtender pop up position
本文介绍了Ajax CalendarExtender弹出位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿伙计我在这里遇到问题这是我的实际代码..
< asp:ImageButton ID = ibtn_To runat = server < span class =code-attribute> 样式 = vertical-align:middle; cursor:pointer; ImageUrl = 〜/ Images / Calendar_scheduleHS.png 宽度 = 16px 高度 = 16px meta:resourcekey = ibtn_ToResource1 / >
< cc1:CalendarExtender ID = ce_ToDate runat = server TargetC ontrolID = txt_ToDate
< span class =code-attribute> 已启用 = True 格式 = dd-MMM-yyyy PopupButtonID = ibtn_To < span class =code-attribute> OnClientDateSelectionChanged = fun_chkDates >
i希望我的日历弹出正好在图像按钮下方...
有没有办法以这种方式设置它的位置....回复: - )
解决方案
我有类似的问题,我用java脚本解决了它。 />
试试这个例子...
添加js代码....
< script type = text / javascript language = javascript >
function onCalendarShown(sender,args){
// 获取已点击以打开日历的图片
var calendarImage =
get(' <%= imgCalendar.ClientID%>' );
// 设置新的日历位置
sender._popupDiv。 parentElement.style.top = calendarImage.offsetTop + calendarImage.height + ' px';
sender._popupDiv.parentElement.style.left = calendarImage.offsetLeft + ' px';
}
< / script >
和asp.net标记代码...
< asp: script manager id = ScriptManager1 runat = server >
< / asp: script manager >
< asp:textbox id = txtDate runat = server / >
< asp:image id = imgCalendar runat = server imageurl = 〜/ Images / calendar.png / >
< cc1:calendarextender id = CalendarExtender1 runat = server targetcontrolid = txtDate
< span class =code-attribute> PopupButtonID = imgCalendar önClientShown = onCalendarShown / >
< / cc1:calendarextender >
它必须有效,如果您有任何问题,请发布到此处,我会向您发送工作示例.. 。
我遇到了同样的问题,只是将我的控件包装在DIV中并将容器DIV的位置设置为绝对值position:absolute
参考此网址:Quote:
Hey guys i'm facing a problem over here this is my actual code..
<asp:ImageButton ID="ibtn_To" runat="server" Style="vertical-align: middle; cursor: pointer;" ImageUrl="~/Images/Calendar_scheduleHS.png" Width="16px" Height="16px" meta:resourcekey="ibtn_ToResource1" />
<cc1:CalendarExtender ID="ce_ToDate" runat="server" TargetControlID="txt_ToDate"
Enabled="True" Format="dd-MMM-yyyy" PopupButtonID="ibtn_To" OnClientDateSelectionChanged="fun_chkDates">
i want my calendar to be popped-up just exact below the image button...
is there any way to set its position in this way....reply :-)
解决方案
Hi,
I had similar problem and I solved it using java script.
Try this example...
Add js code ....
<script type="text/javascript" language="javascript"> function onCalendarShown(sender, args) { // Get Image that was clicked to open calendar var calendarImage =
get('<%=imgCalendar.ClientID %>'); // Set new calendar position sender._popupDiv.parentElement.style.top = calendarImage.offsetTop + calendarImage.height + 'px'; sender._popupDiv.parentElement.style.left = calendarImage.offsetLeft + 'px'; } </script>
and asp.net markup code...
<asp:scriptmanager id="ScriptManager1" runat="server"> </asp:scriptmanager> <asp:textbox id="txtDate" runat="server" /> <asp:image id="imgCalendar" runat="server" imageurl="~/Images/calendar.png" /> <cc1:calendarextender id="CalendarExtender1" runat="server" targetcontrolid="txtDate" PopupButtonID="imgCalendar" önClientShown="onCalendarShown" /> </cc1:calendarextender>
It must work, if you have any problem, just post here and I'll send you working example...
I was at the same problem , just wrapped my control in a DIV and set position to absolute for the container DIVposition:absolute
refer this url :Quote:
这篇关于Ajax CalendarExtender弹出位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文