Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / May 2008

Tip: Looking for answers? Try searching our database.

How call usercontrol function if its inside a formview control?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cirene - 17 May 2008 03:07 GMT
I have a simple usercontrol with a few controls and a few public functions.
It basically is a time control - 1 textbox for Hour, 1 textbox for Minute
and 1 dropdown for am/pm.  Some public functions for example are gettime,
settime, gethour, etc...

I dropped several of these usercontrols inside the InsertItemTemplate of a
formview control.  (It's a work week time scenario.)

QUESTION:  How do I call one of the usercontrols public function?

I tried this but the function won't be called:

i = CType(FormView1.FindControl("ucClosingTimeSunday"),
UserControl).GetHour()

Any ideas what I'm doing wrong?  Thanks!
Cirene - 17 May 2008 03:17 GMT
This seemed to work better...

CType(FormView1.FindControl("ucClosingTimeSunday"), ucTimeSelect).GetHour()

Thanks..

>I have a simple usercontrol with a few controls and a few public functions.
>It basically is a time control - 1 textbox for Hour, 1 textbox for Minute
[quoted text clipped - 12 lines]
>
> Any ideas what I'm doing wrong?  Thanks!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.