Click here to Skip to main content
15,400,390 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys i'm facing a problem over here this is my actual code..

XML
<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 :-)
Posted
Updated 31-Jan-12 15:31pm
v3
Comments
Sergey Alexandrovich Kryukov 31-Jan-12 13:09pm
   
Pop-up on what event? Anyway, simply control its visibility.
--SA

Hi,

I had similar problem and I solved it using java script.

Try this example...

Add js code ....
HTML
<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.NET
<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...
   
v2
Comments
Elegantly Wasted 1-Feb-12 0:03am
   
thanks buddy...:-)
Siva Krishna 18-Aug-12 6:03am
   
please send working example
Martin Arapovic 21-Aug-12 8:50am
   
Hi, You have all code posted here within answer. You only need to create empty aspx page, download/add ajaxcontroltoolkit as reference and paste markup code into page and javascript code in head of your aspx page. If you can't get it to work, contact me by email martinarapovic(at)gmail.com and I'll sent you working example...
I was at the same problem , just wrapped my control in a DIV and set position to absolute for the container DIV
CSS
position:absolute


refer this url :
Quote:
http://languagelassi.blogspot.in/2012/08/blog-post.html
   
Simply put the following code into your page




.ajax__calendar {
position : absolute;
}
   
Comments
Member 14067958 6-Feb-19 9:34am
   
This worked like a charm.
Guys use this code in your aspx

<style>
.fromDtPos
{
left: 277px !important;/* change as per requirement*/
}
.toDtPos
{
left: 519px !important;
}
</style>

mention this in ajax CalendarExtender tag

CssClass="ajax__calendar fromDtPos" /* change as per requirement */
CssClass="ajax__calendar toDtPos"

This has definately solved my problem...
Yo...! :p
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900