Link to home
Start Free TrialLog in
Avatar of gtrapp
gtrapp

asked on

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

Avatar of ororiole
ororiole
Flag of United States of America image

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.
Avatar of gtrapp
gtrapp

ASKER

I think the problem is that I don't have the event defined. What that work?
ASKER CERTIFIED SOLUTION
Avatar of ororiole
ororiole
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gtrapp

ASKER

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