Get from user control

M

Mark Tait

Hi - I have a problem in that my main page, which has a user control,
mtnav.ascx, only picks up on the change made in my user control, a step
behind me actucally making it. I need ti pick up on the changes on the
main page, as changes to the usercontrol should affect which panels I
show/hide on my main page.

My user control (mtnav.ascx) is a table of linkbuttons, which follow
this format:

...onclick="lblSearch_click"... - each of the buttons calls a sub in the
user control:

sub lblSearch_click(sender as object, e as eventargs)
setTab="search"
end sub

setTab is defined as:


public Property setTab as String

Get

return lslsetTab.text

End Get



Set

lblsetTab.text=value

Select case value

case "list"

tdlist.cssclass="mttabon"

tdsearch.cssclass="mttaboff"

case "search"

tdlist.cssclass="mttaboff"

tdsearch.cssclass="mttabon"

end select

End Set



End Property




In my main page, I have:



Sub Page_Load(sender as object, e as eventargs)

If IsPostBack then

response.write(usercontrol1.settab)

End If

end sub




If I click the Search tab, the Search tab of my user control will
change, but not until I select another tab, will the response.write show
Search - it's always a step behind, as if my main Page_Load happens
before the property is set.

Is there anyway of calling Page_Load again, or am I missing something
which would catch the change in the tab the first time around?


Mark Tait
(e-mail address removed)
www.fixitks.co.uk
 

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

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top