Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I have added a calender control to myasp.net form and I disabled it using the visible property. But Iwant to visible true it when a textbox_textchanged and I did it as the below!
 
 
protected void txtDtApp_TextChanged(object sender, EventArgs e)
        {
            clnDates.Visible = true;
        }
 
 
But it didn't displayed and I don't know what to do!
 
Updated Calander Control HTML Code
<asp:Calendar ID="clnDates" runat="server" BackColor="White" 
                        BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" 
                        Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" 
                        onselectionchanged="clnDates_SelectionChanged" Visible="False" Width="200px">
                        <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                        <NextPrevStyle VerticalAlign="Bottom" />
                        <OtherMonthDayStyle ForeColor="#808080" />
                        <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                        <SelectorStyle BackColor="#CCCCCC" />
                        <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                        <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                        <WeekendDayStyle BackColor="#FFFFCC" />
                    </asp:Calendar>
Posted 7-May-13 7:56am
Edited 7-May-13 8:55am
v2
Comments
learner'sbug at 7-May-13 13:12pm
   
did you try to debug it ?
Chiranthaka Sampath at 7-May-13 13:16pm
   
Yes I debug it but no answer!
learner'sbug at 7-May-13 13:24pm
   
Is it hitting your code on text change?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Have you set TextBox property AutoPostBack to true? try this it seems that it is not set true default is false,That's by it is not firing this event.
  Permalink  
Comments
Chiranthaka Sampath at 7-May-13 13:32pm
   
I have done that but the result is the same!
Shriniwas Shukla at 7-May-13 13:36pm
   
As per my understanding you have disable it before this code so you can enable then try to use visible.It may a solution other wise some more code require from you to understand your correct problem.
Chiranthaka Sampath at 7-May-13 13:36pm
   
Ok it took sometime to popup and your suggestion works! Do you have any idea to speedup the popping up the calendar?
Shriniwas Shukla at 7-May-13 13:41pm
   
it may require to review your code.
Chiranthaka Sampath at 7-May-13 13:55pm
   
Question Updated with the Calendar control HTML!
Shriniwas Shukla at 8-May-13 9:06am
   
if all code is running properly then I think you need to check with other browser like IE
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Its is not the effective way to use the calender , use ajax toolkit calender control , follow the link i've given
 
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx[^]
 
If you wan to use in your manner set Autopostback property of textbox true.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Ok guys I have successfully abled to use JQuery http://jquery.com/[^] so the problem was solved ! Thanks for the help anyway!
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 8 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100