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

Posted on 2008-11-07
Medium Priority
Last Modified: 2012-05-05
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" />
In the .CS, code behind:
public void calEvents_SelectionChanged(object sender, EventArgs e)

Open in new window

Question by:gtrapp
  • 2
  • 2
LVL 16

Expert Comment

ID: 22911037
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.

Author Comment

ID: 22911053
I think the problem is that I don't have the event defined. What that work?
LVL 16

Accepted Solution

ororiole earned 750 total points
ID: 22919539
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.

Author Closing Comment

ID: 31514485
Sorry for not responding sooner. I had higher priorities at the time. I did follow your adivice and was able to fix the problem.

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question