We help IT Professionals succeed at work.

re-binding user control data frompage

TrialUser
TrialUser asked
on
214 Views
Last Modified: 2012-08-14
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.
Comment
Watch Question

Commented:
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");

Commented:
c#:

Session["dtProd"] = dtProd;


vb:

Session("dtProd") = dtProd

Author

Commented:
Ok, dtProd is not the problem.

ucProd is the problem. I get dtProd each time anyways and bind it.
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.