D
davinder.kainth
Hi,
I'm a bit new to ASP.net but I've been using it for a few week and have
come across a problem with user controls, well its really to do with
when they are loaded.
Basically I have 2 controls (a.ascx and b.ascx for example) and a main
page, the main page loads both of the controls when it is given to the
client. The idea is that the user will click on a link in control "a"
and will cause control "b" to be loaded.
This currently only sort of works. The way i have set it up is that
after clicking in control "a" the viewstate of the main page is updated
and then when the page reloads it uses these values in the viewstate to
display the relevant user control. As I said this only sort of works,
if i click the link in control "a" twice then control "b" changes.
It seems that after clicking the link the page_load method runs and
then the viewstate is updated, meaning when the page is returned to the
client it was based on the old viewstate.
So the way I see it I either need to find a way to change the viewstate
before the page_load bit runs or need to refresh the page after the
viewstate has been updated. But as I say I'm new to ASP.net so there
maybe other options that I have not considered. Does anyone have any
idea on how I can sort this out?
Cheers
Davinder
I'm a bit new to ASP.net but I've been using it for a few week and have
come across a problem with user controls, well its really to do with
when they are loaded.
Basically I have 2 controls (a.ascx and b.ascx for example) and a main
page, the main page loads both of the controls when it is given to the
client. The idea is that the user will click on a link in control "a"
and will cause control "b" to be loaded.
This currently only sort of works. The way i have set it up is that
after clicking in control "a" the viewstate of the main page is updated
and then when the page reloads it uses these values in the viewstate to
display the relevant user control. As I said this only sort of works,
if i click the link in control "a" twice then control "b" changes.
It seems that after clicking the link the page_load method runs and
then the viewstate is updated, meaning when the page is returned to the
client it was based on the old viewstate.
So the way I see it I either need to find a way to change the viewstate
before the page_load bit runs or need to refresh the page after the
viewstate has been updated. But as I say I'm new to ASP.net so there
maybe other options that I have not considered. Does anyone have any
idea on how I can sort this out?
Cheers
Davinder