lifecycle problem

  • Thread starter thomas via DotNetMonster.com
  • Start date
T

thomas via DotNetMonster.com

I’am programming a portal with a user-search. The normal usersearch is
through the nickname (textbox), which works fine. I also programmed a
detail-usersearch, which give the portal-user the opportunity to search by
more parameters (gender, age, region etc), which works also fine. I the
normal mode I just wanna have the textbox with the nickname-search. Through
a linkbutton I wanna extend the normal search with the detailsearch. In the
linkbutton-event I set a viewstate[“isDetailSearchVisible”] = “true”. And I
check in the page_load method this viewstate. I always create in the
page_load methode the detailsearch, which I add to the htmlgenericcontrol.
But in the normal-search mode I set the visibility of the
htmlgenericcontrol = false. if viewstate[“isDetailSearchVisible”] == “true”
in the page_load methode i set the visibility of the htmlgenericcontrol =
“true”. This works fine and the detailsearch extend the normal-search. The
only proplem is, that I have to fire the linkbutton-event twice unitl the
detailsearch is visible. The reason is the lifecycle of the page, because
page_load comes for linkbutton-event. And this is why I have to fire the
linkbutton event twice. How can I solve this problem, that the detailsearch
becomes visible by the first linkbutton event?

Thanks for any help!
 

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,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top