|
-
May 23rd, 2012, 08:52 AM
#1
Thread Starter
Hyperactive Member
problem with ajax calendar extender not hiding
hello everyone,
i have a calendar extender in my page. it works fine unless i add a maskedEditExtender as well. Then, when the page start or is post back, the calendar starts off as being visible. is there anyway to hide or disable this control when the page starts, until the user clicks the appropriate text box? the code i have is as follows:
Code:
<asp:TextBox ID="TextBox2" runat="server" Width="130px"
MaxLength="1" style="text-align:justify" ValidationGroup="MKE" />
<div id="error2" style="color:red"></div>
<ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server"
TargetControlID="TextBox2"
Mask="99/99/9999"
MaskType="Date"
/>
<ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
ControlExtender="MaskedEditExtender2"
ControlToValidate="TextBox2"
ValidationGroup="MKE2" />
<ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server"
TargetControlID="TextBox2" Animated="False" BehaviorID="calendar2" />
on the codebehind i have:
Code:
Me.TextBox1.Text = Date.Now.AddDays(-7).ToString("MM/dd/yyyy")
Me.TextBox2.Text = Date.Now.AddDays(0).ToString("MM/dd/yyyy")
which seems to be the problem. this cause the focus to go to the calendar control and sets the date, which shows the extender. i've tried to set focus to other controls but nothing seems to work. any help would be great
thanks
jason
Last edited by jasonwucinski; May 23rd, 2012 at 09:15 AM.
if i was able to help, rate my post!
-
May 23rd, 2012, 09:25 AM
#2
Thread Starter
Hyperactive Member
Re: problem with ajax calendar extender not hiding
well, if anyone else needs this, what i did was created some javascript that hides the calendar and sets the focus to another control. like this:
javascript Code:
function pageLoad(sendor,e)
{
var calendarBehavior=$find("calendar2");
calendarBehavior.set_selectedDate('<%=DateTime.Now.ToString() %>');
calendarBehavior.hide()
var getDDL =document.getElementById('reportView1_ddlMatType')
getDDL.focus()
return false
}
if i was able to help, rate my post!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|