Reputation: 15457
I'm trying to build a grid view user control. The user control uses session to keep grid view's datasource alive.
Problem is when I put the user control on my page twice, the session gets mixed up because session name is hard-coded currently. What's the best way resolve this issue?
Upvotes: 0
Views: 51
Reputation: 3681
The best way to save the control's data is to either use ViewState or ControlState. In that way you can isolate the data between different instances of the control in the same page.
Upvotes: 1
Reputation: 420
You may use user control id as key in session instead of hard coding key in session.
Regards, Sandeepkumar Gupta
Upvotes: 0