Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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!

C#
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.NET
<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
Updated 7-May-13 7:55am
v2
Comments
[no name] 7-May-13 13:12pm    
did you try to debug it ?
Chiranthaka Sampath 7-May-13 13:16pm    
Yes I debug it but no answer!
[no name] 7-May-13 13:24pm    
Is it hitting your code on text change?

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.
 
Share this answer
 
Comments
Chiranthaka Sampath 7-May-13 13:32pm    
I have done that but the result is the same!
Shriniwas Shukla 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 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 7-May-13 13:41pm    
it may require to review your code.
Chiranthaka Sampath 7-May-13 13:55pm    
Question Updated with the Calendar control HTML!
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.
 
Share this answer
 
Ok guys I have successfully abled to use JQuery http://jquery.com/[^] so the problem was solved ! Thanks for the help anyway!
 
Share this answer
 

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