How to call user control's method

G

Guest

Hi,

I createed a user control named fnCalender.ascx, there is a method called
getInfo defined in calender.ascx. I drag and drop this control into a web
form then I tried to call the method inside the web form using
fnCalendar1.getInfo(), the source code does not even compile with the error
message "fnCalendar1" is not declared.

I looked into the source code of code behind file, there is no fnCalendar1
defined, it looks like adding an ascx file only changes the aspx file without
declares an instance in the code behind.

Any Ideas,

Thanks in Advance
 
K

Karl

You can simply declare it yourself.

protected fnCalendar1 as Calendar

oftentimes switching to design view and back causes them to show up, or
double clicking the form to go to codebehind...

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top