CS0117: 'ASP.welcome_aspx' does not contain a definition for 'calEvents_SelectionChanged'

I have a ASP.Net 2.0 C$ web project. I have a Calendar control. I also have a event handler in the .CS file that is suppose to be called when there is a selection change on the Calendar control. So, I have code in the ASPX and .CS to handle this. However, I get this error:

Compiler Error Message: CS0117: 'ASP.welcome_aspx' does not contain a definition for 'calEvents_SelectionChanged'

Can you spot the problem:
Code in the ASPX:
 
<asp:Calendar ID="calEvents" runat="server" OnSelectionChanged="calEvents_SelectionChanged" BackColor="White" BorderColor="Black" BorderStyle="Solid" CellSpacing="1" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="250px" NextPrevFormat="ShortMonth" Width="330px">
<SelectedDayStyle BackColor="#333399" ForeColor="White" />
<TodayDayStyle BackColor="#999999" ForeColor="White" />
<OtherMonthDayStyle ForeColor="#999999" />
<DayStyle BackColor="#CCCCCC" />
<NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="White" />
<DayHeaderStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" Height="8pt" />
<TitleStyle BackColor="#333399" BorderStyle="Solid" Font-Bold="True" Font-Size="12pt"
ForeColor="White" Height="12pt" />
</asp:Calendar>
 
In the .CS, code behind:
 
public void calEvents_SelectionChanged(object sender, EventArgs e)
        {
 
        }

Open in new window

gtrappAsked:
Who is Participating?
 
ororioleCommented:
What would be best is respond to my request. If you post the code I requested, I can help you. Instead, you told me what you think the problem is. Why are you asking for help if you are not willing to follw up on my advice.

The problem is that the classname, namespace or filename does not match what is in the page directive. If you can show me how they are defined, we can fix it.
0
 
ororioleCommented:
Hmm, how about your @Page directive at the top of your aspx file. Post that for me. Also post enough of the .cs code behind so I can see the namespace (if any) and Class name.
0
 
gtrappAuthor Commented:
I think the problem is that I don't have the event defined. What that work?
0
 
gtrappAuthor Commented:
Sorry for not responding sooner. I had higher priorities at the time. I did follow your adivice and was able to fix the problem.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.