简体   繁体   中英

Google Calendar In Asp.net C#

I want to make event calendar in my web application.

I use this example but it return error wheni i execute it.

http://www.codeproject.com/Articles/201907/Using-Google-Calendar-in-an-ASP-NET-Website

ERROR IS GIVEN BELOW
-----------------------------------------------------------------------------------
Compiler Error Message: CS0103: The name 'GetCalendarID' does not exist in the current context

Source Error:

Line 11:     <div>
Line 12: 
Line 13:     <iframe name="a" src="https://www.Google.com/calendar/embed?src=<%=GetCalendarID()%>&ctz=Europe%2FMoscow" 
Line 14:             style="border: 0" width="800"
Line 15: height="600" frameborder="0" scrolling="no" id="Test">
-----------------------------------------------------------------------------------

Can any one help me Please?

or if you have better solving then tell me

Regards, Mehmood Alvi

You're trying to call GetCalendarID() (which would more idiomatically be a property, of course) directly from your page - not on an instance of the GoogleCalendar class. Unless you've added all the GoogleCalendar code from CodeProject directly into your page, you need to first create an instance of GoogleCalendar in your code-behind and provide some way of accessing it, eg as a member variable:

<%=calendar.GetCalendarID()%>

Fundamentally, the problem is as simple as the compiler's explained it to be: it can't find a method called GetCalendarID in the context it's got, which is the page. The exact best solution will depend on what else you're doing - the above is just an idea.

You should first call the method SaveCalendarIdAndUrl() cause thats where the m_CalendarId ; gets filled before it can be used by the method GetCalendarID()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM