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

Posted on 2008-11-07
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
    LVL 16

    Expert Comment

    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

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

    Accepted Solution

    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

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
    User art_snob ( encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
    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.…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now