How call usercontrol function if its inside a formview control?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cirene

    How call usercontrol function if its inside a formview control?

    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 InsertItemTempl ate 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("u cClosingTimeSun day"),
    UserControl).Ge tHour()

    Any ideas what I'm doing wrong? Thanks!


  • Cirene

    #2
    Re: How call usercontrol function if its inside a formview control?

    This seemed to work better...

    CType(FormView1 .FindControl("u cClosingTimeSun day"), ucTimeSelect).G etHour()

    Thanks..

    "Cirene" <cirene@nowhere .comwrote in message
    news:ONh6NL8tIH A.1220@TK2MSFTN GP04.phx.gbl...
    >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 InsertItemTempl ate 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("u cClosingTimeSun day"),
    UserControl).Ge tHour()
    >
    Any ideas what I'm doing wrong? Thanks!
    >

    Comment

    Working...