C
Cirene
When you set the value of a user control in a master page, do you have to
reference it differently? Also, do they have to be given different names in
the templates?
For example, this is what I have....
(uc1 is a user control I defined)
MasterPage.master
-- FormView#FormView1
--<EditItemTemplate>
--<table><tr><td>
-- uc1:ucTimeSelect ID="ucTime1"
--<ItemTemplate>
--<table><tr><td>
-- uc1:ucTimeSelect ID="ucTime1"
--<InsertItemTemplate>
--<table><tr><td>
-- uc1:ucTimeSelect ID="ucTime1"
Note that all the user controls have the same name.
In my code, when I switch modes in my formview I am trying to call a
function SetTime in my uc. It seems to work because I check the value
before & after. But it doesn't visually appear on the screen. Here's the
different ways I have tried...
1. CType(FormView1.FindControl("ucTime1"),
common_ucTimeSelect).SetTime(MyTime)
2.
CType(FormView1.Controls(0).Controls(1).Controls(0).FindControl("ucTime1"),
common_ucTimeSelect).SetTime(MyTime)
I check the value of the user control and the time IS set correctly, but
it's doesn't appear set on the screen.
Can you help me out?
Thanks!
reference it differently? Also, do they have to be given different names in
the templates?
For example, this is what I have....
(uc1 is a user control I defined)
MasterPage.master
-- FormView#FormView1
--<EditItemTemplate>
--<table><tr><td>
-- uc1:ucTimeSelect ID="ucTime1"
--<ItemTemplate>
--<table><tr><td>
-- uc1:ucTimeSelect ID="ucTime1"
--<InsertItemTemplate>
--<table><tr><td>
-- uc1:ucTimeSelect ID="ucTime1"
Note that all the user controls have the same name.
In my code, when I switch modes in my formview I am trying to call a
function SetTime in my uc. It seems to work because I check the value
before & after. But it doesn't visually appear on the screen. Here's the
different ways I have tried...
1. CType(FormView1.FindControl("ucTime1"),
common_ucTimeSelect).SetTime(MyTime)
2.
CType(FormView1.Controls(0).Controls(1).Controls(0).FindControl("ucTime1"),
common_ucTimeSelect).SetTime(MyTime)
I check the value of the user control and the time IS set correctly, but
it's doesn't appear set on the screen.
Can you help me out?
Thanks!