Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Why didn't my table1 appear when i wrote the code under the .cs file as
C#
table1.Visible = true;

under the Calendar1_SelectionChanged?

What I am doing is actually hide the table when user first sees the page and appear only when they have selected a certain date in the calendar.

I managed to hide the table, but it does not appear after the calendar date have been selected. Nothing seems to have errors in my code thus I do not really know what is the reason for it not appearing.

This is my codes under the Calendar1_SelectionChanged:
C#
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
        TextBox1.Text = Calendar1.SelectedDate.ToLongDateString();
        Calendar1.Visible = false;
        Label3.Visible = true;
        TextBox2.Visible = true;
        Label4.Visible = true;
        TextBox3.Visible = true;
        table1.Visible = true;
}


Thank you for your help in advance!
Posted
Updated 7-Jul-12 20:19pm
v5
Comments
DaveAuld 8-Jul-12 1:40am    
Have you stepped through the code in the debugger to ensure that your table1.Visible = true; is actually being hit?
DaveAuld 8-Jul-12 1:42am    
What code are you using in the Calendar1_SelectionChanged event? Possibly the mechanism for checkning the date equality to your desired date is flawed or the way you have structured it means that the code to set it visible isn't being hit.
kellycx 8-Jul-12 2:06am    
This is my codes under the Calendar1_SelectionChanged:
<pre lang="c#">protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToLongDateString();
Calendar1.Visible = false;
Label3.Visible = true;
TextBox2.Visible = true;
Label4.Visible = true;
TextBox3.Visible = true;
table1.Visible = true;
}</pre>
I debugged it. i hit the visible code.
Shahin Khorshidnia 8-Jul-12 2:14am    
Please Tag your question, What is it? WinForm? ASP.NET? WPF? ...
kellycx 8-Jul-12 2:20am    
I have tagged my question. It is ASP.NET, sorry about it.

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