Avatar of TrialUser
TrialUser
Flag for Afghanistan asked on

re-binding user control data frompage

I have a page Products.aspx. User control ucProd is inside Products.aspx. ucPager is another user control inside ucProd.

On product page load I bind ucProd as: uProd.dataSource = dtProd to bind a lsitview inside ucProd.

When the user clicks a link button inside ucPager, I need to be able to rebind data to ucProd from Product.aspx.  But when I try to do uProd.dataSource = dtProd , ucProd evaluates to Nothing. Please help.
ASP.NETC#Visual Basic.NET

Avatar of undefined
Last Comment
Rick

8/22/2022 - Mon
Rick

When you get your data the first time, store it in a session variable:

Session("dtProd") = dtProd;

When you bind, instead of:

     uProd.dataSource = dtProd

Use this:

     uProd.dataSource = Session("dtProd");
Rick

c#:

Session["dtProd"] = dtProd;


vb:

Session("dtProd") = dtProd
TrialUser

ASKER
Ok, dtProd is not the problem.

ucProd is the problem. I get dtProd each time anyways and bind it.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
Rick

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.